home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 51 / Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso / -in_the_mag- / workbench / term_4.8 / extras / source / gtlayout-source.lha / LT_New.c < prev    next >
C/C++ Source or Header  |  1997-09-27  |  97KB  |  3,719 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1997 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16.  
  17. /*****************************************************************************/
  18.  
  19.  
  20. VOID
  21. LTP_ReplaceLabelShortcut(LayoutHandle *Handle,ObjectNode * Node)
  22. {
  23.     ULONG    Len;
  24.     STRPTR    Label,*Index = Node->Special.Button.Lines;
  25.     BOOL    GotIt = FALSE;
  26.  
  27.     while(!GotIt)
  28.     {
  29.         if(Index)
  30.         {
  31.             if(!(Label = *Index++))
  32.                 break;
  33.         }
  34.         else
  35.         {
  36.             Label = Node->Label;
  37.             GotIt = TRUE;
  38.         }
  39.  
  40.         Len = 0;
  41.  
  42.         while(Label[Len])
  43.         {
  44.             if(Label[Len] == '_' && Label[Len + 1])
  45.             {
  46.                 STRPTR NewLabel = LTP_Alloc(Handle,strlen(Label));
  47.  
  48.                 if(NewLabel)
  49.                 {
  50.                     if(Len)
  51.                         CopyMem(Label,NewLabel,Len);
  52.  
  53.                     strcpy(&NewLabel[Len],&Label[Len + 1]);
  54.  
  55.                     Node->Special.Button.KeyStroke = &NewLabel[Len];
  56.  
  57.                     Node->Key = ToLower(NewLabel[Len]);
  58.  
  59.                     if(Index)
  60.                         Index[-1] = NewLabel;
  61.                     else
  62.                         Node->Label = NewLabel;
  63.                 }
  64.  
  65.                 GotIt = TRUE;
  66.  
  67.                 break;
  68.             }
  69.  
  70.             Len++;
  71.         }
  72.     }
  73. }
  74.  
  75.  
  76. /*****************************************************************************/
  77.  
  78.  
  79. VOID
  80. LT_AddL(LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...)
  81. {
  82.     if(handle)
  83.     {
  84.         struct TagItem *tagList;
  85.         va_list varArg;
  86.  
  87.         va_start(varArg,id);
  88.  
  89.         tagList = (struct TagItem *)varArg;
  90.  
  91.         if(handle->LocaleHook)
  92.         {
  93.             STRPTR label;
  94.  
  95.             label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)labelID);
  96.  
  97.             LT_AddA(handle,type,label,id,tagList);
  98.         }
  99.         else
  100.             handle->Failed = TRUE;
  101.  
  102.         va_end(varArgs);
  103.     }
  104. }
  105.  
  106.  
  107. /*****************************************************************************/
  108.  
  109.  
  110. VOID
  111. LT_New(LayoutHandle *handle,...)
  112. {
  113.     va_list VarArgs;
  114.  
  115.     va_start(VarArgs,handle);
  116.     LT_NewA(handle,(struct TagItem *)VarArgs);
  117.     va_end(VarArgs);
  118. }
  119.  
  120.  
  121. /*****************************************************************************/
  122.  
  123.  
  124. VOID
  125. LT_Add(LayoutHandle *Handle,LONG Type,STRPTR Label,LONG ID,...)
  126. {
  127.     va_list VarArgs;
  128.  
  129.     va_start(VarArgs,ID);
  130.     LT_AddA(Handle,Type,Label,ID,(struct TagItem *)VarArgs);
  131.     va_end(VarArgs);
  132. }
  133.  
  134.  
  135. /*****************************************************************************/
  136.  
  137.  
  138. VOID LIBENT
  139. LT_AddA(REG(a0) LayoutHandle *Handle,REG(d0) LONG Type,REG(d1) STRPTR Label,REG(d2) LONG ID,REG(a1) struct TagItem *TagList)
  140. {
  141.     struct TagItem *TagItem;
  142.  
  143.     if(!Handle || Handle->Failed)
  144.         return;
  145.  
  146.     if(Type < GENERIC_KIND)
  147.     {
  148.         Handle->Failed = TRUE;
  149.         return;
  150.     }
  151.  
  152.     if(Type == VERTICAL_KIND || Type == HORIZONTAL_KIND || Handle->TopGroup)
  153.     {
  154.         ObjectNode *Node;
  155.         ULONG IDCMP;
  156.  
  157.         IDCMP = NULL;
  158.  
  159.         switch(Type)
  160.         {
  161.             case BUTTON_KIND:
  162.  
  163.                 IDCMP = BUTTONIDCMP;
  164.                 break;
  165.  
  166.             case CHECKBOX_KIND:
  167.  
  168.                 IDCMP = CHECKBOXIDCMP | IDCMP_MOUSEBUTTONS;
  169.                 break;
  170.  
  171.             case LISTVIEW_KIND:
  172.  
  173.                 IDCMP = LISTVIEWIDCMP;
  174.                 break;
  175.  
  176.             case MX_KIND:
  177.  
  178.                 IDCMP = MXIDCMP | IDCMP_MOUSEBUTTONS;
  179.                 break;
  180.  
  181.             case CYCLE_KIND:
  182.  
  183.                 IDCMP = CYCLEIDCMP;
  184.                 break;
  185.  
  186.             case PALETTE_KIND:
  187.  
  188.                 IDCMP = PALETTEIDCMP;
  189.                 break;
  190.  
  191.             case SLIDER_KIND:
  192.  
  193.                 IDCMP = SLIDERIDCMP;
  194.                 break;
  195.  
  196.             case SCROLLER_KIND:
  197.  
  198.                 IDCMP = SCROLLERIDCMP | ARROWIDCMP;
  199.                 break;
  200.  
  201.             case INTEGER_KIND:
  202.  
  203.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN | IDCMP_INTUITICKS;
  204.                 break;
  205.  
  206.             case FRAME_KIND:
  207.  
  208.                 IDCMP = IDCMP_MOUSEBUTTONS;
  209.                 break;
  210.  
  211.             case FRACTION_KIND:
  212.             case STRING_KIND:
  213.             case PASSWORD_KIND:
  214.  
  215.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN;
  216.                 break;
  217.  
  218. #ifdef DO_LEVEL_KIND
  219.             case LEVEL_KIND:
  220.  
  221.                 IDCMP = IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE | IDCMP_GADGETUP;
  222.                 break;
  223. #endif    /* DO_LEVEL_KIND */
  224.  
  225.             case END_KIND:
  226.  
  227.                 Handle->CurrentGroup = Handle->CurrentGroup->Special.Group.ParentGroup;
  228.                 return;
  229.  
  230. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  231.             case POPUP_KIND:
  232.  
  233.                 IDCMP = IDCMP_GADGETUP;
  234.                 break;
  235. #endif
  236.  
  237. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  238.             case TAB_KIND:
  239.  
  240.                 IDCMP = IDCMP_GADGETUP;
  241.                 break;
  242. #endif
  243.         }
  244.  
  245.         Handle->IDCMP |= IDCMP;
  246.  
  247.         if(Node = LTP_CreateObjectNode(Handle,Type,ID,Label))
  248.         {
  249.             struct MinList *ParentList;
  250.             LONG FirstLabel;
  251.             LONG LastLabel;
  252.             LONG *LabelTable;
  253.             LONG *LineTable;
  254.             LONG FirstLine;
  255.             LONG LastLine;
  256.             STRPTR BoxLine;
  257.  
  258.             BoxLine = NULL;
  259.             LabelTable = LineTable = NULL;
  260.             FirstLabel = LastLabel = FirstLine = LastLine = -1;
  261.             Type = Node->Type;
  262.  
  263.             if(Type == GROUP_KIND)
  264.             {
  265.                 Node->Special.Group.ParentGroup = Handle->CurrentGroup;
  266.  
  267.                 if(!ID)
  268.                     Node->ID = Handle->GroupID--;
  269.  
  270.                 if(!Handle->TopGroup)
  271.                 {
  272.                     Handle->TopGroup = Node;
  273.  
  274.                     ParentList = NULL;
  275.                 }
  276.                 else
  277.                     ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  278.  
  279.                 Handle->CurrentGroup = Node;
  280.  
  281.                 NewList((struct List *)&Node->Special.Group.ObjectList);
  282.             }
  283.             else
  284.                 ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  285.  
  286.             if(Label && !Node->NoKey)
  287.             {
  288.                 LONG Len;
  289.  
  290.                 for(Len = 0 ; Label[Len] ; Len++)
  291.                 {
  292.                     if(Label[Len] == '_')
  293.                     {
  294.                         Node->Key = ToLower(Label[Len + 1]);
  295.  
  296.                         break;
  297.                     }
  298.                 }
  299.             }
  300.  
  301.             if(TagList)
  302.             {
  303.                 struct TagItem *TempList = TagList;
  304.                 ULONG ti_Data;
  305.  
  306.                 while(TagItem = NextTagItem(&TempList))
  307.                 {
  308.                     ti_Data = TagItem->ti_Data;
  309.  
  310.                     switch(TagItem->ti_Tag)
  311.                     {
  312.                         case LA_BYTE:
  313.  
  314.                             Node->Storage         = (APTR)ti_Data;
  315.                             Node->StorageType    = STORAGE_BYTE;
  316.  
  317.                             LTP_GetStorage(Node);
  318.  
  319.                             break;
  320.  
  321.                         case LA_UBYTE:
  322.  
  323.                             Node->Storage         = (APTR)ti_Data;
  324.                             Node->StorageType    = STORAGE_UBYTE;
  325.  
  326.                             LTP_GetStorage(Node);
  327.  
  328.                             break;
  329.  
  330.                         case LA_WORD:
  331.  
  332.                             Node->Storage         = (APTR)ti_Data;
  333.                             Node->StorageType    = STORAGE_WORD;
  334.  
  335.                             LTP_GetStorage(Node);
  336.  
  337.                             break;
  338.  
  339.                         case LA_UWORD:
  340.  
  341.                             Node->Storage         = (APTR)ti_Data;
  342.                             Node->StorageType    = STORAGE_UWORD;
  343.  
  344.                             LTP_GetStorage(Node);
  345.  
  346.                             break;
  347.  
  348.                         case LA_LONG:
  349.  
  350.                             Node->Storage         = (APTR)ti_Data;
  351.                             Node->StorageType    = STORAGE_LONG;
  352.  
  353.                             LTP_GetStorage(Node);
  354.  
  355.                             break;
  356.  
  357.                         case LA_ULONG:
  358.  
  359.                             Node->Storage         = (APTR)ti_Data;
  360.                             Node->StorageType    = STORAGE_ULONG;
  361.  
  362.                             LTP_GetStorage(Node);
  363.  
  364.                             break;
  365.  
  366.                         case LA_STRPTR:
  367.  
  368.                             Node->Storage         = (APTR)ti_Data;
  369.                             Node->StorageType    = STORAGE_STRPTR;
  370.  
  371.                             LTP_GetStorage(Node);
  372.  
  373.                             break;
  374.  
  375.                         case LAXB_FullSize:
  376.  
  377.                             if(Type == XBAR_KIND || Type == YBAR_KIND)
  378.                                 Node->Special.Bar.FullSize = ti_Data;
  379.  
  380.                             break;
  381.  
  382.                         case LA_LabelTable:
  383.  
  384.                             LabelTable = (LONG *)ti_Data;
  385.                             break;
  386.  
  387.                         case LA_FirstLabel:
  388.  
  389.                             FirstLabel = ti_Data;
  390.                             break;
  391.  
  392.                         case LA_LastLabel:
  393.  
  394.                             LastLabel = ti_Data;
  395.                             break;
  396.  
  397.                         case LA_LastGadget:
  398.  
  399.                             if(Type == INTEGER_KIND)
  400.                                 Node->Special.Integer.LastGadget = ti_Data;
  401.  
  402.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  403.                                 Node->Special.String.LastGadget = ti_Data;
  404.  
  405.                             break;
  406.  
  407.                         case LA_LabelChars:
  408.  
  409.                             Node->LabelChars = ti_Data;
  410.  
  411.                             break;
  412.  
  413.                         case LA_HistoryLines:
  414.  
  415.                             if(Type == INTEGER_KIND)
  416.                                 Node->Special.Integer.MaxHistoryLines = ti_Data;
  417.  
  418.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  419.                                 Node->Special.String.MaxHistoryLines = ti_Data;
  420.  
  421.                             break;
  422.  
  423.                         case LA_HistoryHook:
  424.  
  425.                             if(Type == INTEGER_KIND)
  426.                                 Node->Special.Integer.HistoryHook = (struct Hook *)ti_Data;
  427.  
  428.                             if(Type == STRING_KIND || Type == FRACTION_KIND)
  429.                                 Node->Special.String.HistoryHook = (struct Hook *)ti_Data;
  430.  
  431.                             break;
  432.  
  433.                         case LAIN_IncrementerHook:
  434.  
  435.                             if(Type == INTEGER_KIND)
  436.                                 Node->Special.Integer.IncrementerHook = (struct Hook *)ti_Data;
  437.  
  438.                             if(Type == FRACTION_KIND)
  439.                             {
  440.                                 if(Node->Special.String.IncrementerHook = (struct Hook *)ti_Data)
  441.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  442.                             }
  443.  
  444.                             break;
  445.  
  446.                         case LA_Min:
  447.  
  448.                             Node->Min = ti_Data;
  449.  
  450.                             break;
  451.  
  452.                         case LA_Max:
  453.  
  454.                             Node->Max = ti_Data;
  455.  
  456.                             break;
  457.  
  458.                         case LABX_Spacing:
  459.  
  460.                             if(Type == BOX_KIND)
  461.                                 Node->Special.Box.Spacing = ti_Data;
  462.  
  463.                             break;
  464.  
  465.                         case LABX_ReserveSpace:
  466.  
  467.                             if(Type == BOX_KIND)
  468.                                 Node->Special.Box.ReserveSpace = ti_Data;
  469.  
  470.                             break;
  471.  
  472.                         case LABX_TextPen:
  473.  
  474.                             if(Type == BOX_KIND)
  475.                                 Node->Special.Box.TextPen = ti_Data;
  476.  
  477.                             break;
  478.  
  479.                         case LABX_BackPen:
  480.  
  481.                             if(Type == BOX_KIND)
  482.                                 Node->Special.Box.BackPen = ti_Data;
  483.  
  484.                             break;
  485.  
  486.                         case LA_Chars:
  487.  
  488.                             Node->Chars = ti_Data;
  489.  
  490.                             break;
  491.  
  492.                         case LA_LabelPlace:
  493.  
  494.                             Node->LabelPlace = ti_Data;
  495.  
  496.                             if(Type == MX_KIND)
  497.                             {
  498.                                 if(ti_Data == PLACE_RIGHT)
  499.                                     Node->LabelPlace = PLACE_RIGHT;
  500.                                 else
  501.                                     Node->LabelPlace = PLACE_LEFT;
  502.                             }
  503.  
  504.                             break;
  505.  
  506.                         case LA_ExtraSpace:
  507.  
  508.                             Node->ExtraSpace = (WORD)ti_Data;
  509.  
  510.                             if(Node->ExtraSpace == 1)
  511.                                 Node->ExtraSpace = 3;
  512.  
  513.                             break;
  514.  
  515.                         case LA_LayoutSpace:
  516.  
  517.                             Node->LayoutSpace = (UWORD)ti_Data;
  518.                             break;
  519.  
  520.                         case LA_PageSelector:
  521.  
  522.                             Node->PageSelector = ti_Data;
  523.                             break;
  524.  
  525.                         case LABT_ExtraFat:
  526.  
  527.                             if(Node->Type == BUTTON_KIND)
  528.                                 Node->Special.Button.ExtraFat = ti_Data;
  529.  
  530.                             break;
  531.  
  532.                         case LABT_Smaller:
  533.  
  534.                             if(Node->Type == BUTTON_KIND)
  535.                                 Node->Special.Button.Smaller = ti_Data;
  536.  
  537.                             break;
  538.  
  539.                         case LABT_DefaultCorrection:
  540.  
  541.                             if(Node->Type == BUTTON_KIND)
  542.                                 Node->Special.Button.DefaultCorrection = ti_Data;
  543.  
  544.                             break;
  545.  
  546.                         case LABT_Lines:
  547.  
  548.                             if(Node->Type == BUTTON_KIND)
  549.                                 Node->Special.Button.Lines = (STRPTR *)ti_Data;
  550.  
  551.                             break;
  552. #ifdef DO_PICKSHORTCUTS
  553.                         case LA_NoKey:
  554.  
  555.                             Node->NoKey = ti_Data;
  556.                             break;
  557. #endif
  558.  
  559.                         case LA_DefaultSize:
  560.  
  561.                             Node->DefaultSize = ti_Data;
  562.                             break;
  563.  
  564.                         case LA_HighLabel:
  565.  
  566.                             Node->HighLabel = ti_Data;
  567.                             break;
  568.  
  569.                         case LAPA_SmallPalette:
  570.  
  571.                             if(Type == PALETTE_KIND)
  572.                                 Node->Special.Palette.SmallPalette = ti_Data;
  573.  
  574.                             break;
  575.  
  576.                         case LAPA_UsePicker:
  577.  
  578.                             if(Type == PALETTE_KIND)
  579.                                 Node->Special.Palette.UsePicker = ti_Data;
  580.  
  581.                             break;
  582.  
  583.                         case LA_Lines:
  584.  
  585.                             if(Type == BOX_KIND)
  586.                             {
  587.                                 LONG Count = ti_Data;
  588.  
  589.                                 if(Node->Lines != Count)
  590.                                 {
  591.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  592.  
  593.                                     Node->Special.Box.Lines = NULL;
  594.                                 }
  595.  
  596.                                 if(!Node->Special.Box.Lines)
  597.                                 {
  598.                                     if(Node->Special.Box.Lines = (STRPTR *)LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  599.                                     {
  600.                                         LONG i;
  601.  
  602.                                         for(i = 0 ; i < Count ; i++)
  603.                                             Node->Special.Box.Lines[i] = "";
  604.                                     }
  605.                                 }
  606.                             }
  607.  
  608.                             Node->Lines = ti_Data;
  609.  
  610.                             break;
  611.  
  612.                         case LA_Picker:
  613.  
  614.                             if(Type == TEXT_KIND)
  615.                                 Node->Special.Text.UsePicker = ti_Data;
  616.  
  617.                             if(Type == STRING_KIND)
  618.                                 Node->Special.String.UsePicker = ti_Data;
  619.  
  620.                             break;
  621.  
  622.                         case LACY_AutoPageID:
  623.  
  624.                             if(Type == CYCLE_KIND)
  625.                                 Node->Special.Cycle.AutoPageID = (LONG)ti_Data;
  626.  
  627. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  628.                             if(Type == POPUP_KIND)
  629.                                 Node->Special.Popup.AutoPageID = (LONG)ti_Data;
  630. #endif
  631.  
  632. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  633.                             if(Type == TAB_KIND)
  634.                                 Node->Special.Tab.AutoPageID = (LONG)ti_Data;
  635. #endif
  636.  
  637.                             if(Type == MX_KIND)
  638.                                 Node->Special.Radio.AutoPageID = (LONG)ti_Data;
  639.  
  640.                             if(Type == LISTVIEW_KIND)
  641.                                 Node->Special.List.AutoPageID = (LONG)ti_Data;
  642.  
  643.                             break;
  644.  
  645.                         case LAGR_Spread:
  646.  
  647.                             if(Type == GROUP_KIND)
  648.                                 Node->Special.Group.Spread = ti_Data;
  649.  
  650.                             break;
  651.  
  652.                         case LAGR_AlignRight:
  653.  
  654.                             if(Type == GROUP_KIND)
  655.                                 Node->Special.Group.AlignRight = ti_Data;
  656.  
  657.                             break;
  658.  
  659.                         case LAGR_FrameGroup:
  660.  
  661.                             if(Type == GROUP_KIND)
  662.                                 Node->Special.Group.FrameType = ti_Data;
  663.  
  664.                             break;
  665. #ifdef NOT_FUNCTIONAL
  666.                         case LAGR_SameWidth:
  667.  
  668.                             if(Type == GROUP_KIND)
  669.                                 Node->Special.Group.UseWidth = ti_Data;
  670.  
  671.                             break;
  672.  
  673.                         case LAGR_SameHeight:
  674.  
  675.                             if(Type == GROUP_KIND)
  676.                                 Node->Special.Group.UseHeight = ti_Data;
  677.  
  678.                             break;
  679. #endif    // NOT_FUNCTIONAL
  680.                         case LAGR_NoIndent:
  681.  
  682.                             if(Type == GROUP_KIND)
  683.                                 Node->Special.Group.NoIndent = ti_Data;
  684.  
  685.                             break;
  686.  
  687.                         case LAGR_IndentX:
  688.  
  689.                             if(Type == GROUP_KIND)
  690.                                 Node->Special.Group.IndentX = ti_Data;
  691.  
  692.                             break;
  693.  
  694.                         case LAGR_IndentY:
  695.  
  696.                             if(Type == GROUP_KIND)
  697.                                 Node->Special.Group.IndentY = ti_Data;
  698.  
  699.                             break;
  700.  
  701.                         case LAGR_Frame:
  702.  
  703.                             if(Type == GROUP_KIND)
  704.                                 Node->Special.Group.Frame = ti_Data;
  705.  
  706.                             break;
  707.  
  708.                         case LAGR_SameSize:
  709.  
  710.                             if(Type == GROUP_KIND)
  711.                                 Node->Special.Group.SameSize = ti_Data;
  712.  
  713.                             break;
  714.  
  715.                         case LAGR_LastAttributes:
  716.  
  717.                             if(Type == GROUP_KIND)
  718.                                 Node->Special.Group.LastAttributes = ti_Data;
  719.  
  720.                             break;
  721.  
  722.                         case LAGR_ActivePage:
  723.  
  724.                             if(Type == GROUP_KIND)
  725.                             {
  726.                                 Node->Special.Group.ActivePage    = ti_Data;
  727.                                 Node->Special.Group.Paging    = TRUE;
  728.                             }
  729.  
  730.                             break;
  731.  
  732.                         case LABT_ReturnKey:
  733.  
  734.                             if(Type == BUTTON_KIND)
  735.                                 Node->Special.Button.ReturnKey = ti_Data;
  736.  
  737.                             break;
  738.  
  739.                         case LABT_EscKey:
  740.  
  741.                             if(Type == BUTTON_KIND)
  742.                                 Node->Special.Button.EscKey = ti_Data;
  743.  
  744.                             break;
  745.  
  746.                         case LALV_AdjustForString:
  747.  
  748.                             if(Type == LISTVIEW_KIND)
  749.                                 Node->Special.List.AdjustForString = ti_Data;
  750.  
  751.                             break;
  752.  
  753.                         case LALV_CursorKey:
  754.  
  755.                             if(Type == LISTVIEW_KIND)
  756.                                 Node->Special.List.CursorKey = ti_Data;
  757.  
  758.                             break;
  759.  
  760.                         case LALV_TextAttr:
  761.  
  762.                             if(Type == LISTVIEW_KIND)
  763.                                 Node->Special.List.TextAttr = (struct TextAttr *)ti_Data;
  764.  
  765.                             break;
  766.  
  767.                         case LALV_LockSize:
  768.  
  769.                             if(Type == LISTVIEW_KIND)
  770.                                 Node->Special.List.LockSize = ti_Data;
  771.  
  772.                             if(Type == TEXT_KIND)
  773.                                 Node->Special.Text.LockSize = ti_Data;
  774.  
  775.                             break;
  776.  
  777.                         case LALV_MaxGrowX:
  778.  
  779.                             if(Type == LISTVIEW_KIND)
  780.                             {
  781.                                 Handle->GrowView = Node;
  782.  
  783.                                 Node->Special.List.MaxGrowX = ti_Data;
  784.                             }
  785.  
  786.                             break;
  787.  
  788.                         case LALV_MaxGrowY:
  789.  
  790.                             if(Type == LISTVIEW_KIND)
  791.                             {
  792.                                 Handle->GrowView = Node;
  793.  
  794.                                 Node->Special.List.MaxGrowY = ti_Data;
  795.                             }
  796.  
  797.                             break;
  798.  
  799.                         case LALV_ResizeX:
  800.  
  801.                             if(Type == LISTVIEW_KIND)
  802.                             {
  803.                                 Handle->ResizeView = Node;
  804.  
  805.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  806.  
  807.                                 Node->Special.List.ResizeX = ti_Data;
  808.                             }
  809.  
  810.                             break;
  811.  
  812.                         case LALV_ResizeY:
  813.  
  814.                             if(Type == LISTVIEW_KIND)
  815.                             {
  816.                                 Handle->ResizeView = Node;
  817.  
  818.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  819.  
  820.                                 Node->Special.List.ResizeY = ti_Data;
  821.                             }
  822.  
  823.                             break;
  824.  
  825.                         case LALV_MinChars:
  826.  
  827.                             if(Type == LISTVIEW_KIND)
  828.                                 Node->Special.List.MinChars = ti_Data;
  829.  
  830.                             break;
  831.  
  832.                         case LALV_MinLines:
  833.  
  834.                             if(Type == LISTVIEW_KIND)
  835.                                 Node->Special.List.MinLines = ti_Data;
  836.  
  837.                             break;
  838.  
  839.                         case LALV_FlushLabelLeft:
  840.  
  841.                             if(Type == LISTVIEW_KIND)
  842.                                 Node->Special.List.FlushLabelLeft = ti_Data;
  843.  
  844.                             break;
  845.  
  846.                         case LALV_Labels:
  847.  
  848.                             if(Type == LISTVIEW_KIND)
  849.                             {
  850.                                 STRPTR *Labels = (STRPTR *)ti_Data;
  851.  
  852.                                 if(*Labels)
  853.                                 {
  854.                                     struct List *SomeList;
  855.  
  856.                                     if(SomeList = LTP_Alloc(Handle,sizeof(struct List)))
  857.                                     {
  858.                                         struct Node *SomeNode;
  859.  
  860.                                         NewList(SomeList);
  861.  
  862.                                         Node->Special.List.Labels = SomeList;
  863.  
  864.                                         while(*Labels)
  865.                                         {
  866.                                             if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node) + strlen(*Labels) + 1))
  867.                                             {
  868.                                                 SomeNode->ln_Name = (STRPTR)(SomeNode + 1);
  869.  
  870.                                                 strcpy(SomeNode->ln_Name,*Labels++);
  871.  
  872.                                                 AddTail(SomeList,SomeNode);
  873.                                             }
  874.                                         }
  875.                                     }
  876.                                 }
  877.                             }
  878.  
  879.                             break;
  880.  
  881.                         case LA_Link:
  882.  
  883.                             if(Type == LISTVIEW_KIND)
  884.                                 Node->Special.List.LinkID = ti_Data;
  885.  
  886.                             if(Type == STRING_KIND)
  887.                                 Node->Special.String.LinkID = ti_Data;
  888.  
  889.                             if(Type == BOOPSI_KIND)
  890.                                 Node->Special.BOOPSI.Link = (LONG)ti_Data;
  891.  
  892.                             break;
  893.  
  894. #ifdef DO_TAPEDECK_KIND
  895.                         case LATD_ButtonType:
  896.  
  897.                             if(Type == TAPEDECK_KIND)
  898.                                 Node->Special.TapeDeck.ButtonType = ti_Data;
  899.  
  900.                             break;
  901.  
  902.                         case LATD_Toggle:
  903.  
  904.                             if(Type == TAPEDECK_KIND)
  905.                                 Node->Special.TapeDeck.Toggle = ti_Data;
  906.  
  907.                             break;
  908.  
  909.                         case LATD_Pressed:
  910.  
  911.                             if(Type == TAPEDECK_KIND)
  912.                                 Node->Current = ti_Data;
  913.  
  914.                             break;
  915.  
  916.                         case LATD_Tick:
  917.  
  918.                             if(Type == TAPEDECK_KIND)
  919.                                 Node->Special.TapeDeck.Tick = ti_Data;
  920.  
  921.                             break;
  922.  
  923.                         case LATD_Smaller:
  924.  
  925.                             if(Type == TAPEDECK_KIND)
  926.                                 Node->Special.TapeDeck.Smaller = ti_Data;
  927.  
  928.                             break;
  929. #endif    /* DO_TAPEDECK_KIND */
  930.  
  931. #ifdef DO_GAUGE_KIND
  932.                         case LAGA_Percent:
  933.  
  934.                             if(Type == GAUGE_KIND)
  935.                             {
  936.                                 LONG Percent = (LONG)ti_Data;
  937.  
  938.                                 if(Percent <= 0)
  939.                                     Node->Current = 0;
  940.                                 else
  941.                                 {
  942.                                     if(Percent > 100)
  943.                                         Node->Current = 100;
  944.                                     else
  945.                                         Node->Current = Percent;
  946.                                 }
  947.                             }
  948.  
  949.                             break;
  950.  
  951.                         case LAGA_NoTicks:
  952.  
  953.                             if(Type == GAUGE_KIND)
  954.                                 Node->Special.Gauge.NoTicks = ti_Data;
  955.  
  956.                             break;
  957.  
  958.                         case LAGA_Discrete:
  959.  
  960.                             if(Type == GAUGE_KIND)
  961.                                 Node->Special.Gauge.Discrete = ti_Data;
  962.  
  963.                             break;
  964.  
  965.                         case LAGA_InfoLength:
  966.  
  967.                             if(Type == GAUGE_KIND)
  968.                             {
  969.                                 LONG Length = (LONG)ti_Data;
  970.  
  971.                                 if(Length > Node->Special.Gauge.InfoLength)
  972.                                 {
  973.                                     STRPTR NewText;
  974.  
  975.                                     if(NewText = (STRPTR)LTP_Alloc(Handle,Length + 1))
  976.                                     {
  977.                                         if(Node->Special.Gauge.InfoText)
  978.                                         {
  979.                                             strcpy(NewText,Node->Special.Gauge.InfoText);
  980.  
  981.                                             LTP_Free(Handle,Node->Special.Gauge.InfoText,Node->Special.Gauge.InfoLength + 1);
  982.                                         }
  983.  
  984.                                         NewText[0] = 0;
  985.  
  986.                                         Node->Special.Gauge.InfoText    = NewText;
  987.                                         Node->Special.Gauge.InfoLength    = Length;
  988.                                     }
  989.                                 }
  990.                             }
  991.  
  992.                             break;
  993.  
  994.                         case LAGA_InfoText:
  995.  
  996.                             if(Type == GAUGE_KIND)
  997.                             {
  998.                                 STRPTR    SomeText    = (STRPTR)ti_Data;
  999.                                 LONG    Len            = strlen(SomeText);
  1000.  
  1001.                                 if(!Node->Special.Gauge.InfoLength)
  1002.                                 {
  1003.                                     if(Node->Special.Gauge.InfoText = (STRPTR)LTP_Alloc(Handle,Len + 1))
  1004.                                         Node->Special.Gauge.InfoLength = Len;
  1005.                                 }
  1006.  
  1007.                                 if(Node->Special.Gauge.InfoLength)
  1008.                                 {
  1009.                                     if(Len > Node->Special.Gauge.InfoLength)
  1010.                                         Len = Node->Special.Gauge.InfoLength;
  1011.  
  1012.                                     CopyMem(SomeText,Node->Special.Gauge.InfoText,Len);
  1013.  
  1014.                                     Node->Special.Gauge.InfoText[Len] = 0;
  1015.                                 }
  1016.                             }
  1017.  
  1018.                             break;
  1019. #endif
  1020.                         case LALV_ExtraLabels:
  1021.  
  1022.                             if(Type == LISTVIEW_KIND)
  1023.                                 Node->Special.List.ExtraLabels = (STRPTR *)ti_Data;
  1024.  
  1025.                             break;
  1026.  
  1027.                         case LACY_TabKey:
  1028.  
  1029.                             if(Type == CYCLE_KIND)
  1030.                                 Node->Special.Cycle.TabKey = ti_Data;
  1031.  
  1032. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  1033.                             if(Type == POPUP_KIND)
  1034.                                 Node->Special.Popup.TabKey = ti_Data;
  1035. #endif
  1036.  
  1037. #if defined(DO_TAB_KIND) && defined(DO_TAB_KIND)
  1038.                             if(Type == TAB_KIND)
  1039.                                 Node->Special.Tab.TabKey = ti_Data;
  1040. #endif
  1041.  
  1042.                             if(Type == MX_KIND)
  1043.                                 Node->Special.Radio.TabKey = ti_Data;
  1044.  
  1045.                             break;
  1046.  
  1047. #if defined(DO_TAB_KIND) && defined(DO_TAB_KIND)
  1048.                         case LATB_FullWidth:
  1049.  
  1050.                             if(Type == TAB_KIND)
  1051.                                 Node->Special.Tab.FullWidth = ti_Data;
  1052.  
  1053.                             break;
  1054. #endif
  1055.  
  1056. #ifdef DO_BOOPSI_KIND
  1057.                         case LABO_FullWidth:
  1058.  
  1059.                             if(Type == BOOPSI_KIND)
  1060.                                 Node->Special.BOOPSI.FullWidth = (WORD)ti_Data;
  1061.  
  1062.                             break;
  1063.  
  1064.                         case LABO_ActivateHook:
  1065.  
  1066.                             if(Type == BOOPSI_KIND)
  1067.                                 Node->Special.BOOPSI.ActivateHook = (struct Hook *)ti_Data;
  1068.  
  1069.                             break;
  1070.  
  1071.                         case LABO_FullHeight:
  1072.  
  1073.                             if(Type == BOOPSI_KIND)
  1074.                                 Node->Special.BOOPSI.FullHeight = (WORD)ti_Data;
  1075.  
  1076.                             break;
  1077.  
  1078.                         case LABO_RelFontHeight:
  1079.  
  1080.                             if(Type == BOOPSI_KIND)
  1081.                                 Node->Special.BOOPSI.RelFontHeight = (WORD)ti_Data;
  1082.  
  1083.                             break;
  1084.  
  1085.                         case LABO_TagScreen:
  1086.  
  1087.                             if(Type == BOOPSI_KIND)
  1088.                                 Node->Special.BOOPSI.TagScreen = ti_Data;
  1089.  
  1090.                             break;
  1091.  
  1092.                         case LABO_TagCurrent:
  1093.  
  1094.                             if(Type == BOOPSI_KIND)
  1095.                                 Node->Special.BOOPSI.TagCurrent = ti_Data;
  1096.  
  1097.                             break;
  1098.  
  1099.                         case LABO_TagLink:
  1100.  
  1101.                             if(Type == BOOPSI_KIND)
  1102.                                 Node->Special.BOOPSI.TagLink = ti_Data;
  1103.  
  1104.                             break;
  1105.  
  1106.                         case LABO_ExactWidth:
  1107.  
  1108.                             if(Type == BOOPSI_KIND)
  1109.                                 Node->Special.BOOPSI.ExactWidth = ti_Data;
  1110.  
  1111.                             break;
  1112.  
  1113.                         case LABO_ExactHeight:
  1114.  
  1115.                             if(Type == BOOPSI_KIND)
  1116.                                 Node->Special.BOOPSI.ExactHeight = ti_Data;
  1117.  
  1118.                             break;
  1119.  
  1120.                         case LABO_TagTextAttr:
  1121.  
  1122.                             if(Type == BOOPSI_KIND)
  1123.                                 Node->Special.BOOPSI.TagTextAttr = ti_Data;
  1124.  
  1125.                             break;
  1126.  
  1127.                         case LABO_TagDrawInfo:
  1128.  
  1129.                             if(Type == BOOPSI_KIND)
  1130.                                 Node->Special.BOOPSI.TagDrawInfo = ti_Data;
  1131.  
  1132.                             break;
  1133.  
  1134.                         case LABO_ClassInstance:
  1135.  
  1136.                             if(Type == BOOPSI_KIND)
  1137.                                 Node->Special.BOOPSI.ClassInstance = (Class *)ti_Data;
  1138.  
  1139.                             break;
  1140.  
  1141.                         case LABO_ClassName:
  1142.  
  1143.                             if(Type == BOOPSI_KIND)
  1144.                                 Node->Special.BOOPSI.ClassName = (STRPTR)ti_Data;
  1145.  
  1146.                             break;
  1147.  
  1148.                         case LABO_ClassLibraryName:
  1149.  
  1150.                             if(Type == BOOPSI_KIND)
  1151.                                 Node->Special.BOOPSI.ClassLibraryName = (STRPTR)ti_Data;
  1152.  
  1153.                             break;
  1154. #endif    /* DO_BOOPSI_KIND */
  1155.                         case LAIM_Image:
  1156.  
  1157.                             if(Node->Type == IMAGE_KIND)
  1158.                                 Node->Special.Image.Image = (struct Image *)ti_Data;
  1159.  
  1160.                             break;
  1161.  
  1162.                         case LAIM_BitMap:
  1163.  
  1164.                             if(Node->Type == IMAGE_KIND)
  1165.                                 Node->Special.Image.BitMap = (struct BitMap *)ti_Data;
  1166.  
  1167.                             break;
  1168.  
  1169.                         case LAIM_BitMapMask:
  1170.  
  1171.                             if(Node->Type == IMAGE_KIND)
  1172.                                 Node->Special.Image.BitMapMask = (PLANEPTR)ti_Data;
  1173.  
  1174.                             break;
  1175.  
  1176.                         case LAIM_BitMapLeft:
  1177.  
  1178.                             if(Node->Type == IMAGE_KIND)
  1179.                                 Node->Special.Image.BitMapLeft = ti_Data;
  1180.  
  1181.                             break;
  1182.  
  1183.                         case LAIM_BitMapTop:
  1184.  
  1185.                             if(Node->Type == IMAGE_KIND)
  1186.                                 Node->Special.Image.BitMapTop = ti_Data;
  1187.  
  1188.                             break;
  1189.  
  1190.                         case LAIM_BitMapWidth:
  1191.  
  1192.                             if(Node->Type == IMAGE_KIND)
  1193.                                 Node->Special.Image.BitMapWidth = ti_Data;
  1194.  
  1195.                             break;
  1196.  
  1197.                         case LAIM_BitMapHeight:
  1198.  
  1199.                             if(Node->Type == IMAGE_KIND)
  1200.                                 Node->Special.Image.BitMapHeight = ti_Data;
  1201.  
  1202.                             break;
  1203.  
  1204.                         case LAFR_RefreshHook:
  1205.  
  1206.                             if(Type == FRAME_KIND)
  1207.                                 Node->Special.Frame.RefreshHook = (struct Hook *)ti_Data;
  1208.  
  1209.                             break;
  1210.  
  1211.                         case LAFR_InnerWidth:
  1212.  
  1213.                             if(Type == FRAME_KIND)
  1214.                                 Node->Special.Frame.InnerWidth = ti_Data;
  1215.  
  1216.                             break;
  1217.  
  1218.                         case LAFR_InnerHeight:
  1219.  
  1220.                             if(Type == FRAME_KIND)
  1221.                                 Node->Special.Frame.InnerHeight = ti_Data;
  1222.  
  1223.                             break;
  1224.  
  1225.                         case LA_DrawBox:
  1226.  
  1227.                             if(Type == FRAME_KIND)
  1228.                                 Node->Special.Frame.DrawBox = ti_Data;
  1229.  
  1230.                             if(Type == BOX_KIND)
  1231.                                 Node->Special.Box.DrawBox = ti_Data;
  1232.  
  1233.                             break;
  1234.  
  1235.                         case LAFR_GenerateEvents:
  1236.  
  1237.                             if(Type == FRAME_KIND)
  1238.                                 Node->Special.Frame.GenerateEvents = ti_Data;
  1239.  
  1240.                             break;
  1241.  
  1242.                         case LABX_AlignText:
  1243.  
  1244.                             if(Type == BOX_KIND)
  1245.                                 Node->Special.Box.AlignText = ti_Data;
  1246.  
  1247.                             break;
  1248.  
  1249.                         case LABX_Line:
  1250.  
  1251.                             if(Type == BOX_KIND)
  1252.                                 BoxLine = (STRPTR)ti_Data;
  1253.  
  1254.                             break;
  1255.  
  1256.                         case LABX_LineID:
  1257.  
  1258.                             if(Type == BOX_KIND)
  1259.                             {
  1260.                                 if(Handle->LocaleHook)
  1261.                                     BoxLine = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)ti_Data);
  1262.                                 else
  1263.                                     Handle->Failed = TRUE;
  1264.                             }
  1265.  
  1266.                             break;
  1267.  
  1268.                         case LABX_Labels:
  1269.  
  1270.                             if(Type == BOX_KIND)
  1271.                             {
  1272.                                 STRPTR    *Labels = (STRPTR *)ti_Data;
  1273.                                 LONG     Count    = 0;
  1274.  
  1275.                                 while(Labels[Count])
  1276.                                     Count++;
  1277.  
  1278.                                 if(Node->Lines != Count)
  1279.                                 {
  1280.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  1281.  
  1282.                                     Node->Special.Box.Lines = NULL;
  1283.                                 }
  1284.  
  1285.                                 if(Count)
  1286.                                 {
  1287.                                     if(!Node->Special.Box.Lines)
  1288.                                     {
  1289.                                         if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  1290.                                         {
  1291.                                             LONG i;
  1292.  
  1293.                                             for(i = 0 ; i < Count ; i++)
  1294.                                                 Node->Special.Box.Lines[i] = "";
  1295.                                         }
  1296.                                     }
  1297.                                 }
  1298.  
  1299.                                 Node->Lines = Count;
  1300.  
  1301.                                 Node->Special.Box.Labels = Labels;
  1302.                             }
  1303.  
  1304.                             break;
  1305.  
  1306.                         case LABX_Lines:
  1307.  
  1308.                             if(Type == BOX_KIND)
  1309.                             {
  1310.                                 STRPTR    *Lines = (STRPTR *)ti_Data;
  1311.                                 LONG     Count = 0;
  1312.  
  1313.                                 while(Lines[Count])
  1314.                                     Count++;
  1315.  
  1316.                                 if(Node->Lines && Count > Node->Lines)
  1317.                                     Count = Node->Lines;
  1318.  
  1319.                                 if(Count)
  1320.                                 {
  1321.                                     if(!Node->Special.Box.Lines)
  1322.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1323.  
  1324.                                     if(Node->Special.Box.Lines)
  1325.                                     {
  1326.                                         LONG i;
  1327.  
  1328.                                         for(i = 0 ; i < Count ; i++)
  1329.                                             Node->Special.Box.Lines[i] = Lines[i];
  1330.                                     }
  1331.                                 }
  1332.  
  1333.                                 Node->Lines = Count;
  1334.                             }
  1335.  
  1336.                             break;
  1337.  
  1338.                         case LABX_LineTable:
  1339.  
  1340.                             if(Type == BOX_KIND)
  1341.                                 LineTable = (LONG *)ti_Data;
  1342.  
  1343.                             break;
  1344.  
  1345.                         case LABX_FirstLine:
  1346.  
  1347.                             if(Type == BOX_KIND)
  1348.                                 FirstLine = ti_Data;
  1349.  
  1350.                             break;
  1351.  
  1352.                         case LABX_LastLine:
  1353.  
  1354.                             if(Type == BOX_KIND)
  1355.                                 LastLine = ti_Data;
  1356.  
  1357.                             break;
  1358.  
  1359.                         case GA_Disabled:
  1360.  
  1361.                             Node->Disabled = ti_Data;
  1362.                             break;
  1363.  
  1364.                         case GTCB_Checked:
  1365.  
  1366.                             if(Type == CHECKBOX_KIND)
  1367.                                 Node->Current = ti_Data;
  1368.  
  1369.                             break;
  1370.  
  1371.                         case GTLV_Labels:
  1372.  
  1373.                             if(Type == LISTVIEW_KIND)
  1374.                             {
  1375.                                 if(ti_Data)
  1376.                                     Node->Special.List.Labels = (struct List *)ti_Data;
  1377.                                 else
  1378.                                     Node->Special.List.Labels = (struct List *)<P_EmptyList;
  1379.                             }
  1380.  
  1381.                             break;
  1382.  
  1383.                         case GTLV_ReadOnly:
  1384.  
  1385.                             if(Type == LISTVIEW_KIND)
  1386.                                 Node->Special.List.ReadOnly = ti_Data;
  1387.  
  1388.                             break;
  1389.  
  1390.                         case GTLV_Selected:
  1391.                         case LALV_Selected:
  1392.  
  1393.                             if(Type == LISTVIEW_KIND)
  1394.                                 Node->Current = (LONG)ti_Data;
  1395.  
  1396.                             break;
  1397.  
  1398.                         case GTLV_CallBack:
  1399.  
  1400.                             if(Type == LISTVIEW_KIND)
  1401.                                 Node->Special.List.CallBack = (struct Hook *)ti_Data;
  1402.  
  1403.                             break;
  1404.  
  1405.                         case GTLV_MaxPen:
  1406.  
  1407.                             if(Type == LISTVIEW_KIND)
  1408.                                 Node->Special.List.MaxPen = ti_Data;
  1409.  
  1410.                             break;
  1411.  
  1412.                         case GTMX_Labels:
  1413.  
  1414.                             if(Type == MX_KIND)
  1415.                                 Node->Special.Radio.Choices = (STRPTR *)ti_Data;
  1416.  
  1417.                             break;
  1418.  
  1419.                         case GTMX_Active:
  1420.  
  1421.                             if(Type == MX_KIND)
  1422.                                 Node->Current = ti_Data;
  1423.  
  1424.                             break;
  1425.  
  1426.                         case GTMX_TitlePlace:
  1427.  
  1428.                             if(Type == MX_KIND && Label)
  1429.                             {
  1430.                                 if(ti_Data == PLACE_RIGHT)
  1431.                                     Node->Special.Radio.TitlePlace = PLACETEXT_RIGHT;
  1432.                                 else
  1433.                                     Node->Special.Radio.TitlePlace = PLACETEXT_LEFT;
  1434.                             }
  1435.  
  1436.                             break;
  1437.  
  1438.                         case GTTX_Text:
  1439.  
  1440.                             if(Type == TEXT_KIND)
  1441.                                 Node->Special.Text.Text = (STRPTR)ti_Data;
  1442.  
  1443.                             break;
  1444.  
  1445.                         case GTTX_FrontPen:
  1446.  
  1447.                             if(Type == TEXT_KIND)
  1448.                                 Node->Special.Text.FrontPen = (WORD)ti_Data;
  1449.  
  1450.                             if(Type == NUMBER_KIND)
  1451.                                 Node->Special.Number.FrontPen = (WORD)ti_Data;
  1452.  
  1453.                             break;
  1454.  
  1455.                         case GTTX_BackPen:
  1456.  
  1457.                             if(Type == TEXT_KIND)
  1458.                                 Node->Special.Text.BackPen = (WORD)ti_Data;
  1459.  
  1460.                             if(Type == NUMBER_KIND)
  1461.                                 Node->Special.Number.BackPen = (WORD)ti_Data;
  1462.  
  1463.                             break;
  1464.  
  1465.                         case GTTX_CopyText:
  1466.  
  1467.                             if(Type == TEXT_KIND)
  1468.                                 Node->Special.Text.CopyText = ti_Data;
  1469.  
  1470.                             break;
  1471.  
  1472.                         case GTTX_Border:
  1473.  
  1474.                             if(Type == TEXT_KIND)
  1475.                                 Node->Special.Text.Border = ti_Data;
  1476.  
  1477.                             break;
  1478.  
  1479.                         case GTNM_Number:
  1480.  
  1481.                             if(Type == NUMBER_KIND)
  1482.                                 Node->Special.Number.Number = ti_Data;
  1483.  
  1484.                             break;
  1485.  
  1486.                         case GTNM_MaxNumberLen:
  1487.  
  1488.                             if(Type == NUMBER_KIND)
  1489.                                 Node->Special.Number.MaxNumberLen = ti_Data;
  1490.  
  1491.                             break;
  1492.  
  1493.                         case GTNM_Format:
  1494.  
  1495.                             if(Type == NUMBER_KIND)
  1496.                                 Node->Special.Number.Format = (STRPTR)ti_Data;
  1497.  
  1498.                             break;
  1499.  
  1500.                         case GTNM_Border:
  1501.  
  1502.                             if(Type == NUMBER_KIND)
  1503.                                 Node->Special.Number.Border = ti_Data;
  1504.  
  1505.                             break;
  1506.  
  1507.                         case GTTX_Justification:
  1508.  
  1509.                             if(Type == NUMBER_KIND)
  1510.                                 Node->Special.Number.Justification = ti_Data;
  1511.  
  1512.                             if(Type == TEXT_KIND)
  1513.                                 Node->Special.Text.Justification = ti_Data;
  1514.  
  1515.                             break;
  1516.  
  1517.                         case LAPU_CentreActive:
  1518.  
  1519.                             if(Type == POPUP_KIND)
  1520.                                 Node->Special.Popup.CentreActive = ti_Data;
  1521.  
  1522.                             break;
  1523.  
  1524.                         case GTCY_Labels:
  1525.  
  1526.                             if(Type == CYCLE_KIND)
  1527.                                 Node->Special.Cycle.Choices = (STRPTR *)ti_Data;
  1528.  
  1529. #if defined(DO_POPUP_KIND)
  1530.                             if(Type == POPUP_KIND)
  1531.                                 Node->Special.Popup.Choices = (STRPTR *)ti_Data;
  1532. #endif
  1533.  
  1534. #if defined(DO_TAB_KIND)
  1535.                             if(Type == TAB_KIND)
  1536.                                 Node->Special.Tab.Choices = (STRPTR *)ti_Data;
  1537. #endif
  1538.  
  1539.                             break;
  1540.  
  1541.                         case GTCY_Active:
  1542.  
  1543.                             if(Type == CYCLE_KIND)
  1544.                                 Node->Current = ti_Data;
  1545.  
  1546. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  1547.                             if(Type == POPUP_KIND)
  1548.                                 Node->Current = ti_Data;
  1549. #endif
  1550.  
  1551. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  1552.                             if(Type == TAB_KIND)
  1553.                                 Node->Current = ti_Data;
  1554. #endif
  1555.  
  1556.                             break;
  1557.  
  1558.                         case GTPA_Depth:
  1559.  
  1560.                             if(Type == PALETTE_KIND)
  1561.                             {
  1562.                                 Node->Special.Palette.Depth = ti_Data;
  1563.  
  1564.                                 if(Handle->MaxPen < (1L << Node->Special.Palette.Depth) - 1)
  1565.                                     Handle->MaxPen = (1L << Node->Special.Palette.Depth) - 1;
  1566.                             }
  1567.  
  1568.                             break;
  1569.  
  1570.                         case GTPA_Color:
  1571.  
  1572.                             if(Type == PALETTE_KIND)
  1573.                                 Node->Current = ti_Data;
  1574.  
  1575.                             break;
  1576.  
  1577.                         case GTPA_ColorOffset:
  1578.  
  1579.                             if(Type == PALETTE_KIND)
  1580.                                 Node->Min = ti_Data;
  1581.  
  1582.                             break;
  1583.  
  1584.                         case GTPA_NumColors:
  1585.  
  1586.                             if(Type == PALETTE_KIND)
  1587.                             {
  1588.                                 Node->Special.Palette.NumColours = ti_Data;
  1589.  
  1590.                                 if(Node->Special.Palette.ColourTable)
  1591.                                 {
  1592.                                     LONG i;
  1593.  
  1594.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1595.                                     {
  1596.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1597.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1598.                                     }
  1599.                                 }
  1600.                             }
  1601.  
  1602.                             break;
  1603.  
  1604.                         case GTPA_ColorTable:
  1605.  
  1606.                             if(Type == PALETTE_KIND)
  1607.                             {
  1608.                                 Node->Special.Palette.ColourTable = (UBYTE *)ti_Data;
  1609.  
  1610.                                 if(Node->Special.Palette.NumColours)
  1611.                                 {
  1612.                                     LONG i;
  1613.  
  1614.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1615.                                     {
  1616.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1617.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1618.                                     }
  1619.                                 }
  1620.                             }
  1621.  
  1622.                             break;
  1623.  
  1624.                         case GA_RelVerify:
  1625.  
  1626.                             if(Type == SCROLLER_KIND)
  1627.                                 Node->Special.Scroller.RelVerify = ti_Data;
  1628.  
  1629.                             break;
  1630.  
  1631.                         case GA_Immediate:
  1632.  
  1633.                             if(Type == SCROLLER_KIND)
  1634.                                 Node->Special.Scroller.Immediate = ti_Data;
  1635.  
  1636.                             break;
  1637.  
  1638.                         case GTSC_Top:
  1639.  
  1640.                             if(Type == SCROLLER_KIND)
  1641.                                 Node->Current = ti_Data;
  1642.  
  1643.                             break;
  1644.  
  1645.                         case GTSC_Total:
  1646.  
  1647.                             if(Type == SCROLLER_KIND)
  1648.                                 Node->Max = ti_Data;
  1649.  
  1650.                             break;
  1651.  
  1652.                         case GTSC_Visible:
  1653.  
  1654.                             if(Type == SCROLLER_KIND)
  1655.                                 Node->Special.Scroller.Visible = ti_Data;
  1656.  
  1657.                             break;
  1658.  
  1659.                         case GTSC_Arrows:
  1660.  
  1661.                             if(Type == SCROLLER_KIND)
  1662.                                 Node->Special.Scroller.Arrows = (ti_Data != 0);
  1663.  
  1664.                             break;
  1665.  
  1666.                         case LASC_Thin:
  1667.  
  1668.                             if(Type == SCROLLER_KIND)
  1669.                                 Node->Special.Scroller.Thin = ti_Data;
  1670.  
  1671.                             break;
  1672.  
  1673.                         case LASC_FullSize:
  1674.  
  1675.                             if(Type == SCROLLER_KIND)
  1676.                             {
  1677.                                 Node->Special.Scroller.FullSize = ti_Data;
  1678.                                 Node->Special.Scroller.Parent = Handle->CurrentGroup;
  1679.                             }
  1680.  
  1681.                             break;
  1682.  
  1683.                         case PGA_Freedom:
  1684.  
  1685.                             if(Type == SCROLLER_KIND)
  1686.                                 Node->Special.Scroller.Vertical = (ti_Data == LORIENT_VERT);
  1687.  
  1688. #ifdef DO_LEVEL_KIND
  1689.                             if(Type == LEVEL_KIND)
  1690.                                 Node->Special.Level.Freedom = (ti_Data == FREEVERT) ? FREEVERT : FREEHORIZ;
  1691. #endif /* DO_LEVEL_KIND */
  1692.  
  1693.                             break;
  1694.  
  1695. #ifdef DO_LEVEL_KIND
  1696.  
  1697.                         case LAVL_Freedom:
  1698.  
  1699.                             if(Type == LEVEL_KIND)
  1700.                                 Node->Special.Level.Freedom = (ti_Data == FREEVERT) ? FREEVERT : FREEHORIZ;
  1701.  
  1702.                             break;
  1703.  
  1704.                         case LAVL_Ticks:
  1705.  
  1706.                             if(Type == LEVEL_KIND)
  1707.                                 Node->Special.Level.Ticks = ti_Data;
  1708.  
  1709.                             break;
  1710.  
  1711.                         case LAVL_NumTicks:
  1712.  
  1713.                             if(Type == LEVEL_KIND)
  1714.                                 Node->Special.Level.NumTicks = ti_Data;
  1715.  
  1716.                             break;
  1717.  
  1718. #endif    /* DO_LEVEL_KIND */
  1719.  
  1720.                         case GTSL_Min:
  1721.  
  1722.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1723.                                 Node->Min = ti_Data;
  1724.  
  1725.                             break;
  1726.  
  1727.                         case GTSL_Max:
  1728.  
  1729.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1730.                                 Node->Max = ti_Data;
  1731.  
  1732.                             break;
  1733.  
  1734.                         case GTSL_Level:
  1735.  
  1736.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1737.                                 Node->Current = ti_Data;
  1738.  
  1739.                             break;
  1740.  
  1741.                         case GTSL_LevelFormat:
  1742.  
  1743. #ifdef DO_LEVEL_KIND
  1744.                             if(Type == LEVEL_KIND)
  1745.                                 Node->Special.Level.LevelFormat = (STRPTR)ti_Data;
  1746. #endif    /* DO_LEVEL_KIND */
  1747.  
  1748.                             if(Type == SLIDER_KIND)
  1749.                                 Node->Special.Slider.LevelFormat = (STRPTR)ti_Data;
  1750.  
  1751.                             break;
  1752.  
  1753.                         case GTSL_LevelPlace:
  1754.  
  1755. #ifdef DO_LEVEL_KIND
  1756.                             if(Type == LEVEL_KIND)
  1757.                             {
  1758.                                 if(ti_Data == PLACE_RIGHT)
  1759.                                     Node->Special.Level.LevelPlace = PLACETEXT_RIGHT;
  1760.                                 else
  1761.                                     Node->Special.Level.LevelPlace = PLACETEXT_LEFT;
  1762.                             }
  1763. #endif    /* DO_LEVEL_KIND */
  1764.  
  1765.                             if(Type == SLIDER_KIND)
  1766.                             {
  1767.                                 if(ti_Data == PLACE_RIGHT)
  1768.                                     Node->Special.Slider.LevelPlace = PLACETEXT_RIGHT;
  1769.                                 else
  1770.                                     Node->Special.Slider.LevelPlace = PLACETEXT_LEFT;
  1771.                             }
  1772.  
  1773.                             break;
  1774.  
  1775.                         case GTSL_DispFunc:
  1776.  
  1777. #ifdef DO_LEVEL_KIND
  1778.                             if(Type == LEVEL_KIND)
  1779.                                 Node->Special.Level.DispFunc = (DISPFUNC)ti_Data;
  1780. #endif    /* DO_LEVEL_KIND */
  1781.  
  1782.                             if(Type == SLIDER_KIND)
  1783.                                 Node->Special.Slider.DispFunc = (DISPFUNC)ti_Data;
  1784.  
  1785.                             break;
  1786.  
  1787.                         case LASL_FullCheck:
  1788.  
  1789.                             if(Type == SLIDER_KIND)
  1790.                                 Node->Special.Slider.FullLevelCheck = ti_Data;
  1791.  
  1792. #ifdef DO_LEVEL_KIND
  1793.                             if(Type == LEVEL_KIND)
  1794.                                 Node->Special.Level.FullLevelCheck = ti_Data;
  1795. #endif    /* DO_LEVEL_KIND */
  1796.  
  1797.                             break;
  1798.  
  1799.                         case GTST_String:
  1800.  
  1801.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1802.                                 Node->Special.String.String = (STRPTR)ti_Data;
  1803.  
  1804.                             break;
  1805.  
  1806.                         case LAST_Activate:
  1807.  
  1808.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1809.                                 Node->Special.String.Activate = ti_Data;
  1810.  
  1811.                             if(Type == INTEGER_KIND)
  1812.                                 Node->Special.Integer.Activate = ti_Data;
  1813.  
  1814.                             break;
  1815.  
  1816.                         case GTST_MaxChars:
  1817.  
  1818.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1819.                                 Node->Special.String.MaxChars = ti_Data;
  1820.  
  1821.                             break;
  1822.  
  1823.                         case GTST_EditHook:
  1824.  
  1825.                             if(Type == STRING_KIND)
  1826.                                 Node->Special.String.EditHook = (struct Hook *)ti_Data;
  1827.                             else
  1828.                             {
  1829.                                 if(Type == INTEGER_KIND)
  1830.                                 {
  1831.                                     if(Node->Special.Integer.EditHook = (struct Hook *)ti_Data)
  1832.                                         Node->Special.Integer.CustomHook = TRUE;
  1833.                                 }
  1834.                             }
  1835.  
  1836.                             break;
  1837.  
  1838.                         case LAST_ValidateHook:
  1839.  
  1840.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1841.                                 Node->Special.String.ValidateHook = (struct Hook *)ti_Data;
  1842.                             else
  1843.                             {
  1844.                                 if(Type == INTEGER_KIND)
  1845.                                     Node->Special.Integer.ValidateHook = (struct Hook *)ti_Data;
  1846.                             }
  1847.  
  1848.                             break;
  1849.  
  1850.                         case STRINGA_Justification:
  1851.  
  1852.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1853.                                 Node->Special.String.Justification = ti_Data;
  1854.                             else
  1855.                             {
  1856.                                 if(Type == INTEGER_KIND)
  1857.                                     Node->Special.Integer.Justification = ti_Data;
  1858.                             }
  1859.  
  1860.                             break;
  1861.  
  1862.                         case LAIN_UseIncrementers:
  1863.  
  1864.                             if(Type == INTEGER_KIND)
  1865.                             {
  1866.                                 if(Node->Special.Integer.UseIncrementers = ti_Data)
  1867.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  1868.                             }
  1869.  
  1870.                             break;
  1871.  
  1872.                         case GTIN_Number:
  1873.  
  1874.                             if(Type == INTEGER_KIND)
  1875.                                 Node->Special.Integer.Number = ti_Data;
  1876.  
  1877.                             break;
  1878.  
  1879.                         case GTIN_MaxChars:
  1880.  
  1881.                             if(Type == INTEGER_KIND)
  1882.                                 Node->Special.Integer.MaxChars = ti_Data;
  1883.  
  1884.                             break;
  1885.                     }
  1886.                 }
  1887.             }
  1888.  
  1889.             if(Handle->Failed)
  1890.                 return;
  1891.  
  1892.             switch(Type)
  1893.             {
  1894.                 case STRING_KIND:
  1895.                 case INTEGER_KIND:
  1896.                 case FRACTION_KIND:
  1897.  
  1898.                     if(Node->Special.String.MaxHistoryLines)
  1899.                     {
  1900.                         if(!Node->Special.Integer.HistoryHook)
  1901.                         {
  1902.                             struct Hook *Hook;
  1903.  
  1904.                             if(Hook = (struct Hook *)LTP_Alloc(Handle,sizeof(struct Hook) + sizeof(struct MinList)))
  1905.                             {
  1906.                                 struct MinList *List;
  1907.  
  1908.                                 List = Hook->h_Data = (APTR)(Hook + 1);
  1909.  
  1910.                                 NewList((struct List *)List);
  1911.  
  1912.                                 Hook->h_Entry = (HOOKFUNC)LTP_DefaultHistoryHook;
  1913.  
  1914.                                 Node->Special.Integer.HistoryHook = Hook;
  1915.                             }
  1916.                         }
  1917.  
  1918.                         if(Node->Special.Integer.HistoryHook)
  1919.                         {
  1920.                             struct Node    *TextNode;
  1921.                             struct MinList *List;
  1922.  
  1923.                             List = (struct List *)Node->Special.Integer.HistoryHook->h_Data;
  1924.  
  1925.                             Node->Special.Integer.LayoutHandle = Handle;
  1926.                             Node->Special.Integer.NumHistoryLines = 0;
  1927.  
  1928.                             TextNode = (struct Node *)List->mlh_Head;
  1929.  
  1930.                             while(TextNode->ln_Succ)
  1931.                             {
  1932.                                 Node->Special.Integer.NumHistoryLines++;
  1933.  
  1934.                                 TextNode = TextNode->ln_Succ;
  1935.                             }
  1936.                         }
  1937.                     }
  1938.  
  1939.                     break;
  1940.  
  1941. #if defined(DO_BOOPSI_KIND) && defined(DO_TAB_KIND)
  1942.  
  1943.                 case TAB_KIND:
  1944.  
  1945.                     Node->Special.Tab.Parent = Handle->CurrentGroup;
  1946.                     break;
  1947. #endif
  1948.  
  1949. #ifdef DO_BOOPSI_KIND
  1950.                 case BOOPSI_KIND:
  1951.  
  1952.                     Node->Special.BOOPSI.Parent = Handle->CurrentGroup;
  1953.  
  1954.                     if(Node->Special.BOOPSI.ClassTags = CloneTagItems(TagList))
  1955.                     {
  1956.                         STATIC ULONG Exclude[] =
  1957.                         {
  1958.                             LA_Chars,
  1959.                             LA_Lines,
  1960.                             LABO_TagCurrent,
  1961.                             LABO_TagTextAttr,
  1962.                             LABO_TagDrawInfo,
  1963.                             LABO_ClassInstance,
  1964.                             LABO_ClassName,
  1965.                             LABO_ClassLibraryName,
  1966.                             LABO_ExactWidth,
  1967.                             LABO_ExactHeight,
  1968.  
  1969.                             TAG_DONE
  1970.                         };
  1971.  
  1972.                         FilterTagItems(Node->Special.BOOPSI.ClassTags,(Tag *)Exclude,TAGFILTER_NOT);
  1973.                     }
  1974.                     else
  1975.                         Handle->Failed = TRUE;
  1976.  
  1977.                     break;
  1978. #endif    /* DO_BOOPSI_KIND */
  1979.  
  1980.                 case TEXT_KIND:
  1981.  
  1982.                     if(Node->Special.Text.CopyText && Node->Special.Text.Text)
  1983.                     {
  1984.                         STRPTR text;
  1985.  
  1986.                         if(text = LTP_Alloc(Handle,strlen(Node->Special.Text.Text) + 1))
  1987.                         {
  1988.                             strcpy(text,Node->Special.Text.Text);
  1989.  
  1990.                             Node->Special.Text.Text = text;
  1991.                         }
  1992.                     }
  1993.  
  1994.                     break;
  1995.  
  1996.                 case BOX_KIND:
  1997.  
  1998.                     if(FirstLine != -1 && LastLine != -1)
  1999.                     {
  2000.                         if(FirstLine <= LastLine && Handle->LocaleHook)
  2001.                         {
  2002.                             LONG Count = LastLine - FirstLine + 1;
  2003.  
  2004.                             if(Node->Lines && Count > Node->Lines)
  2005.                                 Count = Node->Lines;
  2006.                             else
  2007.                                 Node->Lines = Count;
  2008.  
  2009.                             if(Count)
  2010.                             {
  2011.                                 if(!Node->Special.Box.Lines)
  2012.                                     Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2013.  
  2014.                                 if(Node->Special.Box.Lines)
  2015.                                 {
  2016.                                     LONG i;
  2017.  
  2018.                                     for(i = 0 ; i < Count ; i++)
  2019.                                         Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLine + i));
  2020.                                 }
  2021.                             }
  2022.                         }
  2023.                         else
  2024.                             Handle->Failed = TRUE;
  2025.                     }
  2026.                     else
  2027.                     {
  2028.                         if(LineTable)
  2029.                         {
  2030.                             if(Handle->LocaleHook)
  2031.                             {
  2032.                                 LONG Count = 0;
  2033.  
  2034.                                 while(LineTable[Count] != -1)
  2035.                                     Count++;
  2036.  
  2037.                                 if(Node->Lines && Count > Node->Lines)
  2038.                                     Count = Node->Lines;
  2039.                                 else
  2040.                                     Node->Lines = Count;
  2041.  
  2042.                                 if(Count)
  2043.                                 {
  2044.                                     if(!Node->Special.Box.Lines)
  2045.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2046.  
  2047.                                     if(Node->Special.Box.Lines)
  2048.                                     {
  2049.                                         LONG i;
  2050.  
  2051.                                         for(i = 0 ; i < Count ; i++)
  2052.                                             Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(LineTable[i]));
  2053.                                     }
  2054.                                 }
  2055.                             }
  2056.                             else
  2057.                                 Handle->Failed = TRUE;
  2058.                         }
  2059.                         else
  2060.                         {
  2061.                             if(BoxLine)
  2062.                             {
  2063.                                 LONG Count,i;
  2064.  
  2065.                                 for(i = 0, Count = 1 ; i < strlen(BoxLine) ; i++)
  2066.                                 {
  2067.                                     if(BoxLine[i] == '\n')
  2068.                                         Count++;
  2069.                                 }
  2070.  
  2071.                                 if(Node->Lines && Count > Node->Lines)
  2072.                                     Count = Node->Lines;
  2073.                                 else
  2074.                                     Node->Lines = Count;
  2075.  
  2076.                                 if(Count)
  2077.                                 {
  2078.                                     if(!Node->Special.Box.Lines)
  2079.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2080.  
  2081.                                     if(Node->Special.Box.Lines)
  2082.                                     {
  2083.                                         STRPTR From,To;
  2084.                                         LONG Len;
  2085.  
  2086.                                         From = BoxLine;
  2087.  
  2088.                                         for(i = 0 ; i < Count ; i++)
  2089.                                         {
  2090.                                             for(To = From ; *To ; To++)
  2091.                                             {
  2092.                                                 if(*To == '\n')
  2093.                                                     break;
  2094.                                             }
  2095.  
  2096.                                             Len = (LONG)(To - From);
  2097.  
  2098.                                             if(Node->Special.Box.Lines[i] = LTP_Alloc(Handle,Len + 1))
  2099.                                             {
  2100.                                                 if(Len)
  2101.                                                     CopyMem(From,Node->Special.Box.Lines[i],Len);
  2102.  
  2103.                                                 Node->Special.Box.Lines[i][Len] = 0;
  2104.  
  2105.                                                 From = To + 1;
  2106.                                             }
  2107.                                         }
  2108.                                     }
  2109.                                 }
  2110.                             }
  2111.                         }
  2112.                     }
  2113.  
  2114.                     break;
  2115.             }
  2116.  
  2117.             if((FirstLabel != -1 && LastLabel != -1) || LabelTable)
  2118.             {
  2119.                 if(!Handle->LocaleHook)
  2120.                     Handle->Failed = TRUE;
  2121.                 else
  2122.                 {
  2123.                     if(Type == LISTVIEW_KIND)
  2124.                     {
  2125.                         struct List *SomeList;
  2126.  
  2127.                         if(SomeList = (struct List *)LTP_Alloc(Handle,sizeof(struct MinList)))
  2128.                         {
  2129.                             struct Node    *SomeNode;
  2130.                             LONG         Count = (LastLabel - FirstLabel + 1),i;
  2131.  
  2132.                             NewList(SomeList);
  2133.  
  2134.                             Node->Special.List.Labels = SomeList;
  2135.  
  2136.                             if(LabelTable)
  2137.                             {
  2138.                                 while(*LabelTable != -1)
  2139.                                 {
  2140.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  2141.                                     {
  2142.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  2143.  
  2144.                                         AddTail(SomeList,SomeNode);
  2145.                                     }
  2146.                                 }
  2147.                             }
  2148.                             else
  2149.                             {
  2150.                                 for(i = 0 ; i < Count ; i++)
  2151.                                 {
  2152.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  2153.                                     {
  2154.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  2155.  
  2156.                                         AddTail(SomeList,SomeNode);
  2157.                                     }
  2158.                                 }
  2159.                             }
  2160.                         }
  2161.                     }
  2162.                     else
  2163.                     {
  2164.                         if(Type == MX_KIND || Type == CYCLE_KIND || Type == POPUP_KIND || Type == TAB_KIND || Type == BOX_KIND || Type == BUTTON_KIND)
  2165.                         {
  2166.                             STRPTR    *Labels;
  2167.                             LONG     Count,i;
  2168.  
  2169.                             if(LabelTable)
  2170.                             {
  2171.                                 LONG *Index = LabelTable;
  2172.  
  2173.                                 for(Count = 0 ; *Index != -1 ; Count++, Index++);
  2174.                             }
  2175.                             else
  2176.                                 Count = (LastLabel - FirstLabel + 1);
  2177.  
  2178.                             if(Labels = LTP_Alloc(Handle,sizeof(STRPTR) * (Count + 1)))
  2179.                             {
  2180.                                 if(LabelTable)
  2181.                                 {
  2182.                                     for(i = 0 ; i < Count ; i++)
  2183.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  2184.                                 }
  2185.                                 else
  2186.                                 {
  2187.                                     for(i = 0 ; i < Count ; i++)
  2188.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  2189.                                 }
  2190.  
  2191.                                 Labels[i] = NULL;
  2192.  
  2193.                                 switch(Type)
  2194.                                 {
  2195.                                     case BUTTON_KIND:
  2196.  
  2197.                                         Node->Special.Button.Lines = Labels;
  2198.                                         break;
  2199.  
  2200.                                     case MX_KIND:
  2201.  
  2202.                                         Node->Special.Radio.Choices = Labels;
  2203.                                         break;
  2204.  
  2205.                                     case CYCLE_KIND:
  2206.  
  2207.                                         Node->Special.Cycle.Choices = Labels;
  2208.                                         break;
  2209.  
  2210. #if defined(DO_POPUP_KIND)
  2211.                                     case POPUP_KIND:
  2212.  
  2213.                                         Node->Special.Popup.Choices = Labels;
  2214.                                         break;
  2215. #endif
  2216.  
  2217. #if defined(DO_TAB_KIND)
  2218.                                     case TAB_KIND:
  2219.  
  2220.                                         Node->Special.Tab.Choices = Labels;
  2221.                                         break;
  2222. #endif
  2223.  
  2224.                                     case BOX_KIND:
  2225.  
  2226.                                         if(!Node->Special.Box.Lines)
  2227.                                         {
  2228.                                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  2229.                                             {
  2230.                                                 LONG i;
  2231.  
  2232.                                                 for(i = 0 ; i < Count ; i++)
  2233.                                                     Node->Special.Box.Lines[i] = "";
  2234.                                             }
  2235.                                         }
  2236.  
  2237.                                         Node->Lines = Count;
  2238.  
  2239.                                         Node->Special.Box.Labels = Labels;
  2240.  
  2241.                                         break;
  2242.                                 }
  2243.                             }
  2244.                         }
  2245.                     }
  2246.                 }
  2247.             }
  2248.  
  2249.             switch(Type)
  2250.             {
  2251.                 case BUTTON_KIND:
  2252.  
  2253.                     if(!Node->NoKey && !Node->Special.Button.KeyStroke && (Node->Special.Button.Lines || Node->Special.Button.ReturnKey))
  2254.                     {
  2255.                         LTP_ReplaceLabelShortcut(Handle,Node);
  2256.                     }
  2257.  
  2258.                     break;
  2259.  
  2260.                 case BOX_KIND:
  2261.  
  2262.                     if(Node->Special.Box.ReserveSpace)
  2263.                     {
  2264.                         LONG    Size;
  2265.                         STRPTR    Buffer;
  2266.  
  2267.                         if(!Node->Special.Box.Lines)
  2268.                         {
  2269.                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Node->Lines))
  2270.                             {
  2271.                                 LONG i;
  2272.  
  2273.                                 for(i = 0 ; i < Node->Lines ; i++)
  2274.                                     Node->Special.Box.Lines[i] = "";
  2275.                             }
  2276.                         }
  2277.  
  2278.                         if(!Node->Chars)
  2279.                             Size = 10;
  2280.                         else
  2281.                             Size = Node->Chars;
  2282.  
  2283.                         Node->Special.Box.MaxSize = Size;
  2284.  
  2285.                         if(Buffer = (STRPTR)LTP_Alloc(Handle,(Size + 1) * Node->Lines))
  2286.                         {
  2287.                             LONG i,Len;
  2288.  
  2289.                             for(i = 0 ; i < Node->Lines ; i++)
  2290.                             {
  2291.                                 if(Node->Special.Box.Lines[i])
  2292.                                 {
  2293.                                     Len = strlen(Node->Special.Box.Lines[i]);
  2294.  
  2295.                                     if(Len > Size)
  2296.                                         Len = Size;
  2297.  
  2298.                                     CopyMem(Node->Special.Box.Lines[i],Buffer,Len);
  2299.  
  2300.                                     Buffer[Len] = 0;
  2301.                                 }
  2302.                                 else
  2303.                                     Buffer[0] = 0;
  2304.  
  2305.                                 Node->Special.Box.Lines[i] = Buffer;
  2306.  
  2307.                                 Buffer += Size + 1;
  2308.                             }
  2309.                         }
  2310.                     }
  2311.  
  2312.                     break;
  2313.  
  2314.                 case XBAR_KIND:
  2315.                 case YBAR_KIND:
  2316.  
  2317.                     Node->Special.Bar.Parent = Handle->CurrentGroup;
  2318.                     break;
  2319.  
  2320. #ifdef DO_PASSWORD_KIND
  2321.  
  2322.                 case PASSWORD_KIND:
  2323.                 {
  2324.                     STRPTR Buffer;
  2325.  
  2326.                     if(Buffer = LTP_Alloc(Handle,2 * (Node->Special.String.MaxChars + 1)))
  2327.                     {
  2328.                         Node->Special.String.RealString    = Buffer;
  2329.                         Node->Special.String.Original    = Buffer + Node->Special.String.MaxChars + 1;
  2330.  
  2331.                         if(Node->Special.String.String)
  2332.                         {
  2333.                             strcpy(Node->Special.String.RealString,Node->Special.String.String);
  2334.                             strcpy(Node->Special.String.Original,Node->Special.String.String);
  2335.                         }
  2336.                     }
  2337.  
  2338.                     break;
  2339.                 }
  2340. #endif
  2341.  
  2342.                 case FRACTION_KIND:
  2343.  
  2344.                     Node->Special.String.RealString = LTP_Alloc(Handle,Node->Special.String.MaxChars + 1);
  2345.                     break;
  2346.             }
  2347.  
  2348.             if(ParentList)
  2349.                 AddTail((struct List *)ParentList,(struct Node *)Node);
  2350.         }
  2351.     }
  2352. }
  2353.  
  2354.  
  2355. /*****************************************************************************/
  2356.  
  2357.  
  2358. /****** gtlayout.library/LT_NewA ******************************************
  2359. *
  2360. *   NAME
  2361. *    LT_NewA -- Add a new object to the user interface tree.
  2362. *
  2363. *   SYNOPSIS
  2364. *    LT_NewA(Handle,Tags);
  2365. *             A0    A1
  2366. *
  2367. *    VOID LT_NewA(LayoutHandle *,struct TagItem *);
  2368. *
  2369. *    LT_New(Handle,...);
  2370. *
  2371. *    VOID LT_New(LayoutHandle *,...);
  2372. *
  2373. *   FUNCTION
  2374. *    LT_NewA() is the routine you use to build the user interface,
  2375. *    you give layout directions, design groups, etc. and finally
  2376. *    call LT_BuildA() to turn these specifications into a window.
  2377. *
  2378. *   INPUTS
  2379. *    Handle - Pointer to LayoutHandle structure.
  2380. *
  2381. *
  2382. *    This routine will accept almost all create-time tag items
  2383. *    gadtools.library/CreateGadget will handle. In addition to
  2384. *    this there are a bunch of extra gadget objects and extra
  2385. *    tag items supported:
  2386. *
  2387. *    All object types:
  2388. *
  2389. *        LA_Type (LONG) - Type of the object to create, must be
  2390. *            one of the following:
  2391. *
  2392. *                TEXT_KIND
  2393. *                VERTICAL_KIND
  2394. *                HORIZONTAL_KIND
  2395. *                END_KIND
  2396. *                FRAME_KIND
  2397. *                BOX_KIND
  2398. *                SLIDER_KIND
  2399. *                LISTVIEW_KIND
  2400. *                INTEGER_KIND
  2401. *                STRING_KIND
  2402. *                PASSWORD_KIND
  2403. *                PALETTE_KIND
  2404. *                BUTTON_KIND
  2405. *                CHECKBOX_KIND
  2406. *                NUMBER_KIND
  2407. *                GAUGE_KIND
  2408. *                CYCLE_KIND
  2409. *                POPUP_KIND
  2410. *                TAB_KIND
  2411. *                MX_KIND
  2412. *                XBAR_KIND
  2413. *                YBAR_KIND
  2414. *                TAPEDECK_KIND
  2415. *                LEVEL_KIND
  2416. *                BOOPSI_KIND
  2417. *                BLANK_KIND (V36)
  2418. *                FRACTION_KIND (V38)
  2419. *                IMAGE_KIND (V41)
  2420. *
  2421. *        LA_LabelText (STRPTR) - The object label text to use.
  2422. *
  2423. *        LA_LabelID (LONG) - The locale text ID of the string to
  2424. *            use as the object label text.
  2425. *
  2426. *                NOTE: LT_NewA() will fail if you forget
  2427. *                    to select a hook with LAHN_LocaleHook
  2428. *                    at LT_CreateHandleTagList.
  2429. *
  2430. *        LA_ID (LONG) - The gadget ID to use for this object.
  2431. *
  2432. *                NOTE: User ID values *MUST* be greater than 0,
  2433. *                      negative values are reserved for internal
  2434. *                      use.
  2435. *
  2436. *        LA_Chars (LONG) - The width of this object measured in
  2437. *            characters. If each character of the user interface
  2438. *            font is 8 pixels wide an object with LA_Chars set to
  2439. *            10 will usually be 80 pixels wide.
  2440. *
  2441. *        LA_LabelChars (LONG) - This forces the internal gadget
  2442. *            label width the layout engine calculates during the
  2443. *            layout pass to a specific value. Note: this does
  2444. *            not work well with all objects. (V9)
  2445. *
  2446. *        LA_LabelPlace (LONG) - Where to place the gadget label.
  2447. *            Not all objects will support all label positions:
  2448. *
  2449. *                PLACE_LEFT - Place label text left of object
  2450. *                PLACE_RIGHT - Place label text right of object
  2451. *                PLACE_ABOVE - Place label text above object
  2452. *                PLACE_IN - Place label text in object
  2453. *                PLACE_BELOW - Place label text below object
  2454. *
  2455. *        LA_ExtraSpace (BOOL) - Add extra vertical/horizontal
  2456. *            space before this object.
  2457. *            Default: FALSE
  2458. *
  2459. *        LA_ExtraFat (BOOL) - Make this object a bit larger
  2460. *            than its usual size.
  2461. *            Default: FALSE
  2462. *
  2463. *        LA_NoKey (BOOL) - Don't let the user interface choose
  2464. *            a keyboard shortcut for this object.
  2465. *            Default: FALSE
  2466. *
  2467. *        LA_HighLabel (BOOL) - Use highlight pen when rendering
  2468. *            the gadget label text.
  2469. *            Default: FALSE
  2470. *
  2471. *        LA_BYTE (BYTE *) - Pointer to the variable that holds
  2472. *            the "current value" of the object. The layout engine
  2473. *            will retrieve this value initially during the creation
  2474. *            of the object and maintain it during its lifespan.
  2475. *            This means you do not need to worry about checking
  2476. *            the state of the object, the user interface layout
  2477. *            engine will do it for you.
  2478. *
  2479. *        LA_UBYTE (UBYTE *) - Pointer to the variable that holds
  2480. *            the "current value" of the object. The layout engine
  2481. *            will retrieve this value initially during the creation
  2482. *            of the object and maintain it during its lifespan.
  2483. *            This means you do not need to worry about checking
  2484. *            the state of the object, the user interface layout
  2485. *            engine will do it for you.
  2486. *
  2487. *        LA_WORD (WORD *) - Pointer to the variable that holds
  2488. *            the "current value" of the object. The layout engine
  2489. *            will retrieve this value initially during the creation
  2490. *            of the object and maintain it during its lifespan.
  2491. *            This means you do not need to worry about checking
  2492. *            the state of the object, the user interface layout
  2493. *            engine will do it for you.
  2494. *
  2495. *        LA_UWORD (UWORD *) - Pointer to the variable that holds
  2496. *            the "current value" of the object. The layout engine
  2497. *            will retrieve this value initially during the creation
  2498. *            of the object and maintain it during its lifespan.
  2499. *            This means you do not need to worry about checking
  2500. *            the state of the object, the user interface layout
  2501. *            engine will do it for you.
  2502. *
  2503. *        LA_BOOL (BOOL *) - Pointer to the variable that holds
  2504. *            the "current value" of the object. The layout engine
  2505. *            will retrieve this value initially during the creation
  2506. *            of the object and maintain it during its lifespan.
  2507. *            This means you do not need to worry about checking
  2508. *            the state of the object, the user interface layout
  2509. *            engine will do it for you.
  2510. *
  2511. *        LA_LONG (LONG *) - Pointer to the variable that holds
  2512. *            the "current value" of the object. The layout engine
  2513. *            will retrieve this value initially during the creation
  2514. *            of the object and maintain it during its lifespan.
  2515. *            This means you do not need to worry about checking
  2516. *            the state of the object, the user interface layout
  2517. *            engine will do it for you.
  2518. *
  2519. *        LA_ULONG (ULONG *) - Pointer to the variable that holds
  2520. *            the "current value" of the object. The layout engine
  2521. *            will retrieve this value initially during the creation
  2522. *            of the object and maintain it during its lifespan.
  2523. *            This means you do not need to worry about checking
  2524. *            the state of the object, the user interface layout
  2525. *            engine will do it for you.
  2526. *
  2527. *        LA_STRPTR (STRPTR) - Pointer to the variable that holds
  2528. *            the "current value" of the object. The layout engine
  2529. *            will retrieve this value initially during the creation
  2530. *            of the object and maintain it during its lifespan.
  2531. *            This means you do not need to worry about checking
  2532. *            the state of the object, the user interface layout
  2533. *            engine will do it for you.
  2534. *
  2535. *        LA_FRACTION (FRACTION *) - Pointer to the variable that holds
  2536. *            the "current value" of the object. The layout engine
  2537. *            will retrieve this value initially during the creation
  2538. *            of the object and maintain it during its lifespan.
  2539. *            This means you do not need to worry about checking
  2540. *            the state of the object, the user interface layout
  2541. *            engine will do it for you.
  2542. *
  2543. *
  2544. *        BLANK_KIND (transparent placeholder):
  2545. *
  2546. *            (requires gtlayout.library V36 or higher)
  2547. *
  2548. *            No tags are defined for this type of object.
  2549. *
  2550. *
  2551. *        BOOPSI_KIND:
  2552. *
  2553. *            (requires gtlayout.library V10 or higher)
  2554. *
  2555. *            LABO_TagCurrent (Tag) - The Tag ID that represents the
  2556. *                current object value. For PROPGCLASS this would be
  2557. *                PGA_Top.
  2558. *
  2559. *            LABO_TagTextAttr (Tag) - The Tag ID that represents the
  2560. *                TextAttr value the object expects. For gadgets this
  2561. *                would be GA_TextAttr.
  2562. *
  2563. *            LABO_TagDrawInfo (Tag) - The Tag ID that represents the
  2564. *                DrawInfo value the object expects.
  2565. *
  2566. *            LABO_TagLink (Tag) - The Tag ID that represents a pointer
  2567. *                to a different object the object expects. For the
  2568. *                colorwheel.gadget this would be WHEEL_GradientSlider.
  2569. *
  2570. *            LABO_TagScreen (Tag) - The Tag ID that represents the
  2571. *                screen the object expects. For the colorwheel.gadget
  2572. *                this would be WHEEL_Screen.
  2573. *
  2574. *            LABO_Link (LONG) - The ID of the object this object should
  2575. *                be linked to. This will be resolved later when gadgets
  2576. *                are created.
  2577. *
  2578. *                    NOTE: Forward references are not resolved, only
  2579. *                        backward references are allowed. This means that
  2580. *                        if you wish to link object A to object B,
  2581. *                        object A must be created before object B
  2582. *                        is created.
  2583. *
  2584. *            LABO_ClassInstance (Class *) - This is the first parameter
  2585. *                you would pass to NewObjectA().
  2586. *
  2587. *                    NOTE: Only classes derived from gadgetclass and
  2588. *                      gadgetclass itself may be used.
  2589. *
  2590. *            LABO_ClassName (STRPTR) - This is the second parameter you would
  2591. *                pass to NewObject().
  2592. *
  2593. *                    NOTE: Only classes derived from gadgetclass and
  2594. *                        gadgetclass itself may be used.
  2595. *
  2596. *            LABO_ClassLibraryName (STRPTR) - This tag is particularly useful
  2597. *                for gadget class implementations wrapped into libraries, such as
  2598. *                colorwheel.gadget. When opened, they make the classes they
  2599. *                represent publicly available so subsequent calls to
  2600. *                NewObject(NULL,<Classname>,...) can be made. The
  2601. *                LABO_ClassLibraryName tag will cause gtlayout.library to open
  2602. *                the class library before any calls to NewObject() are made.
  2603. *
  2604. *                    NOTE: Only classes derived from gadgetclass and
  2605. *                        gadgetclass itself may be used.
  2606. *
  2607. *                        The LABO_ClassLibraryName tag requires that you
  2608. *                        specify the class name with the LABO_ClassName. It is
  2609. *                        not enough to just use the LABO_ClassLibraryName tag.
  2610. *
  2611. *            LABO_ExactWidth (WORD) - This is the exact width of the object to
  2612. *                use. This effectively overrides whatever you specified using
  2613. *                the LA_Chars tag and keeps gtlayout.library from shrinking and
  2614. *                expanding the object as needed.
  2615. *
  2616. *            LABO_ExactHeight (WORD) - This is the exact height of the object to
  2617. *                use. This effectively overrides whatever you specified using
  2618. *                the LA_Lines tag and keeps gtlayout.library from shrinking and
  2619. *                expanding the object as needed.
  2620. *
  2621. *            LABO_RelFontHeight (WORD) - This tag affects the height of the
  2622. *                object; when specified, it is derived from the user interface
  2623. *                font height plus the value given with LABO_RelFontHeight.
  2624. *
  2625. *            LABO_FullWidth (BOOL) - Use this tag if you wish the object to
  2626. *                cover the entire width of the group it resides within.
  2627. *
  2628. *            LABO_FullHeight (BOOL) - Use this tag if you wish the object to
  2629. *                cover the entire height of the group it resides within.
  2630. *
  2631. *            LABO_ActivateHook (struct Hook *) - Hook to invoke when the
  2632. *                layout engine decides that this particular object should
  2633. *                be activated. The hook is called with the following
  2634. *                parameters:
  2635. *
  2636. *                Success = ActivateFunc(struct Hook *Hook,LayoutHandle *Handle,
  2637. *                  D0                                 A0                  A2
  2638. *
  2639. *                             Object *object)
  2640. *                                       A1
  2641. *
  2642. *                The object pointer actually refers to the instance of the
  2643. *                BOOPSI object created. Return FALSE if your object could not
  2644. *                be activated, TRUE if it worked. If you return TRUE, no special
  2645. *                keyboard event will be generated. (V13)
  2646. *
  2647. *            NOTE: All tags passed to LT_New() for BOOPSI_KIND objects are
  2648. *                passed through to NewObjectA() later. The library makes
  2649. *                a copy of the tag item list, so all data valid in the
  2650. *                scope when LT_New() is called must also be valid later
  2651. *                when LT_Build() is invoked.
  2652. *
  2653. *                The gadget label is *NOT* passed through to the object,
  2654. *                it effectively receives the label a plain gadtools object
  2655. *                would receive, similar to what happens to FRAME_KIND
  2656. *                objects and the like.
  2657. *
  2658. *
  2659. *        BOX_KIND (multiline text display):
  2660. *
  2661. *            LABX_Chars (LONG) - The width of this object in
  2662. *                characters. The layout routine will try to make
  2663. *                sure that the given number of characters will
  2664. *                fit into a single line of text in this box.
  2665. *                This may be a problem with proportional spaced
  2666. *                fonts.
  2667. *               Default: 10
  2668. *
  2669. *            LABX_Labels (STRPTR *) - The label texts to display
  2670. *                on the right hand side of the box. Terminate
  2671. *                this array with NULL.
  2672. *
  2673. *            LABX_Lines (STRPTR *) - The text to display in the
  2674. *                box. Terminate this array with NULL.
  2675. *
  2676. *            LABX_Rows (LONG) - The height of this object in
  2677. *                characters.
  2678. *
  2679. *            LABX_AlignText (LONG) - Controls how text is aligned
  2680. *                in box lines:
  2681. *
  2682. *                    ALIGNTEXT_LEFT - Align text to the left edge
  2683. *                    ALIGNTEXT_CENTERED - Centre the text
  2684. *                    ALIGNTEXT_RIGHT - Align text to the right edge
  2685. *                    ALIGNTEXT_PAD - Pad text lines
  2686. *
  2687. *                Default: ALIGNTEXT_LEFT
  2688. *
  2689. *            LABX_DrawBox (BOOL) - Draw a recessed bevel box
  2690. *                around the text box.
  2691. *                Default: FALSE
  2692. *
  2693. *            LABX_FirstLabel (LONG) - Locale string ID of the first
  2694. *                text to use as a box label. Works in conjunction
  2695. *                with LABX_LastLabel.
  2696. *
  2697. *            LABX_LastLabel (LONG) - Locale string ID of the last
  2698. *                text to use as a box label. Works in conjunction
  2699. *                with LABX_FirstLabel. When building the interface the
  2700. *                code will loop from FirstLabel..LastLabel, look
  2701. *                up the corresponding locale strings and use the
  2702. *                data to make up the label text to appear at the
  2703. *                right hand side of the box.
  2704. *
  2705. *            LABX_LabelTable (LONG *) - Pointer to an array of IDs
  2706. *                to use for building the box labels. This requires
  2707. *                that a locale hook is provided with the layout handle.
  2708. *                The array is terminated by -1.
  2709. *
  2710. *            LABX_ReserveSpace (BOOL) - Allocate extra memory to hold
  2711. *                the contents of the lines displayed. This avoids nasty
  2712. *                side-effects when refreshing this object.
  2713. *                Default: FALSE
  2714. *
  2715. *            LABX_FirstLine (LONG) - Locale string ID of the first
  2716. *                text to print inside the box. Works in conjunction
  2717. *                with LABX_LastLine. (V26)
  2718. *
  2719. *            LABX_LastLine (LONG) - Locale string ID of the last
  2720. *                text to print inside the box. Works in conjunction
  2721. *                with LABX_FirstLine. (V26)
  2722. *
  2723. *            LABX_LineTable (LONG *) - Pointer to an array of IDs
  2724. *                to use for building the box contents lines. This requires
  2725. *                that a locale hook is provided with the layout handle.
  2726. *                The array is terminated by -1. (V28)
  2727. *
  2728. *            LABX_Line (STRPTR) - Line to display in the box, may
  2729. *                contain '\n' line break characters, the layout engine
  2730. *                will chop the single line into single consecutive lines
  2731. *                following the '\n' chars. (V31)
  2732. *
  2733. *            LABX_LineID (LONG) - Locale ID of line text to display in the
  2734. *                box, may contain '\n' line break characters, the layout
  2735. *                engine will chop the single line into single consecutive lines
  2736. *                following the '\n' chars. (V31)
  2737. *
  2738. *            LABX_TextPen (WORD) - Box text colour to use. (V40)
  2739. *
  2740. *            LABX_BackPen (WORD) - Box text background colour to use. (V40)
  2741. *
  2742. *            LABX_Spacing (UWORD) - Request that additional pixels should
  2743. *                separate lines of text. (V41)
  2744. *                Default: 0
  2745. *
  2746. *
  2747. *        BUTTON_KIND:
  2748. *
  2749. *            LA_Label (STRPTR)
  2750. *            LA_LabelID (LONG) - These two define the button label, i.e.
  2751. *                the text that is printed within the button box. Optionally,
  2752. *                this text may include newline characters ("\n") which will
  2753. *                cause the button text to be broken into several lines.
  2754. *                This particular feature requires gtlayout.library v12 or
  2755. *                higher. Single line label have always been supported.
  2756. *
  2757. *            LABT_ReturnKey (BOOL) - Let the user operate this
  2758. *                button by pressing the return key, making it the
  2759. *                so-called default button, or default choice. The
  2760. *                button select box will appear slightly bolder than
  2761. *                normal buttons are.
  2762. *
  2763. *                    NOTE: there can be only one single button per
  2764. *                        window to sport this feature.
  2765. *
  2766. *                Default: FALSE
  2767. *
  2768. *            LABT_EscKey (BOOL) - Let the user operate this
  2769. *                button by pressing the Escape key.
  2770. *
  2771. *                    NOTE: there can be only one single button per
  2772. *                        window to use this feature.
  2773. *
  2774. *                Default: FALSE
  2775. *
  2776. *            LABT_ExtraFat (BOOL) - Make this button a bit
  2777. *                larger than usual.
  2778. *                Default: FALSE
  2779. *
  2780. *            LABT_Lines (STRPTR *) - Use the given string array
  2781. *                to create a multiline gadget label. Terminate the
  2782. *                array with a NULL. (V12)
  2783. *
  2784. *            LABT_FirstLine (LONG) - Locale ID of first label line. (V12)
  2785. *
  2786. *            LABT_LastLine (LONG) - Locale ID of last label line. (V12)
  2787. *
  2788. *            LABT_DefaultCorrection (BOOL) - Make the button slightly
  2789. *                wider and taller so its size matches the default
  2790. *                button. (V21)
  2791. *
  2792. *            LABT_Smaller (BOOL) - Make this button a little smaller
  2793. *                than usual. (V21)
  2794. *
  2795. *
  2796. *        CYCLE_KIND:
  2797. *
  2798. *            LACY_FirstLabel (LONG) - Locale string ID of the first
  2799. *                text to use as a label. Works in conjunction
  2800. *                with LACY_LastLabel.
  2801. *
  2802. *            LACY_LastLabel (LONG) - Locale string ID of the last
  2803. *                text to use as a label. Works in conjunction
  2804. *                with LACY_FirstLabel. When building the interface the
  2805. *                code will loop from FirstLabel..LastLabel, look
  2806. *                up the corresponding locale strings and use the
  2807. *                data to make up the label text.
  2808. *
  2809. *            LACY_LabelTable (LONG *) - Pointer to an array of IDs
  2810. *                to use for building the cycle labels. This requires
  2811. *                that a locale hook is provided with the layout handle.
  2812. *                The array is terminated by -1.
  2813. *
  2814. *            LACY_TabKey (BOOL) - Connect this object to the tabulator
  2815. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  2816. *                to cycle to the previous entry. (V9)
  2817. *
  2818. *                    NOTE: there can be only one single button per
  2819. *                        window to use this feature.
  2820. *
  2821. *                Default: FALSE
  2822. *
  2823. *            LACY_AutoPageID (LONG) - ID of paged GROUP_KIND object
  2824. *                which will be set to the gadget's current setting.
  2825. *                If this tag is set, you will hear no events from this
  2826. *                object any more. (V7)
  2827. *
  2828. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  2829. *                        which may be generated if the layout
  2830. *                        engine runs out of memory when rebuilding
  2831. *                        the user interface.
  2832. *
  2833. *
  2834. *        FRACTION_KIND:
  2835. *
  2836. *            (requires gtlayout.library V38 or higher)
  2837. *
  2838. *            This is a special kind of STRING_KIND which comes with a
  2839. *            special input filter. It will allow only for floating point
  2840. *            numbers to be entered, i.e. numbers (`0'-`9') and one
  2841. *            decimal point (`.' or whatever your current locale uses
  2842. *            as the decimal point character). What you will receive as
  2843. *            user input text will be in the following format:
  2844. *
  2845. *                (0|#[0-9]).(0|#[0-9])
  2846. *
  2847. *            Or in other words, text like this will be returned:
  2848. *
  2849. *                0.0
  2850. *                7.0
  2851. *                0.9
  2852. *                146654.0
  2853. *
  2854. *            NOTE: While this object type did exist in earlier library
  2855. *                  versions support for it was removed in V33. It was
  2856. *                  eventually reintroduced with the functionality described
  2857. *                  above in V38.
  2858. *
  2859. *            LAFR_IncrementerHook (struct Hook *) - Hook to invoke when the
  2860. *                incrementer arrows are used. The hook function will receive
  2861. *                three parameters and has to return a result code:
  2862. *
  2863. *                    a0 - (struct Hook *)  Pointer to this hook
  2864. *                    a2 - (STRPTR) Current value of this object
  2865. *                    a1 - (LONG) Either INCREMENTERMSG_Decrement or
  2866. *                                INCREMENTERMSG_Increment
  2867. *
  2868. *                If the hook function modifies the current value it must
  2869. *                return TRUE, otherwise FALSE must be returned. If you return
  2870. *                TRUE, then the library will update the object. (V40)
  2871. *
  2872. *            This object type accepts all the GTST_#? tag items.
  2873. *
  2874. *
  2875. *        FRAME_KIND (fixed size general purpose display,
  2876. *            you may render into it):
  2877. *
  2878. *            LAFR_InnerWidth (LONG) - Inner width of the
  2879. *                display box.
  2880. *
  2881. *            LAFR_InnerHeight (LONG) - Inner height of the
  2882. *                display box.
  2883. *
  2884. *            LAFR_DrawBox (BOOL) - Draw a recessed bevel box
  2885. *                around the display box.
  2886. *                Default: FALSE
  2887. *
  2888. *            LAFR_RefreshHook (struct Hook *) - Hook to call
  2889. *                when refreshing/redrawing this object. See
  2890. *                gtlayout.h for more information. (V9)
  2891. *
  2892. *            LAFR_GenerateEvents (BOOL) - If TRUE, clicking
  2893. *                inside the FRAME_KIND object will generate
  2894. *                IDCMP_GADGETUP/IDCMP_GADGETDOWN events. If
  2895. *                you wish to know where the click occured,
  2896. *                make a copy of the Window->MouseX/Y entries
  2897. *                before you call LT_HandleInput()/LT_GetIMsg(). (V28)
  2898. *                Default: FALSE
  2899. *
  2900. *
  2901. *        GAUGE_KIND (general purpose progress report display):
  2902. *
  2903. *            LAGA_Percent (LONG) - Indicator position, can range
  2904. *                from 0..100.
  2905. *                Default: 0
  2906. *
  2907. *            LAGA_InfoLength (LONG) - Maximum number of characters
  2908. *                to reserve for text printed in the gauge display.
  2909. *                Default: 0
  2910. *
  2911. *            LAGA_InfoText (STRPTR) - Text to print in the gauge
  2912. *                display.
  2913. *
  2914. *            LAGA_Tenth (BOOL) - Instead of a continuously growing
  2915. *                bar you will get a set of exactly ten blocks,
  2916. *                each separated by a hairline. (V19)
  2917. *                Default: FALSE
  2918. *
  2919. *               LAGA_NoTicks (BOOL) - If TRUE suppresses drawing the
  2920. *                   ticks below the gauge box.
  2921. *                   Default: FALSE
  2922. *
  2923. *
  2924. *        IMAGE_KIND (display area for Image or BitMap data):
  2925. *
  2926. *            (requires gtlayout.library V41 or higher)
  2927. *
  2928. *            LAIM_Image (struct Image *) - Image to draw in this
  2929. *                place. When the user interface is built, it will
  2930. *                be drawn using intuition.library/DrawImage().
  2931. *
  2932. *            LAIM_BitMap (struct BitMap *) - You can supply a
  2933. *                BitMap instead of an Image which will be drawn
  2934. *                using either graphics.library/BltBitMapRastPort()
  2935. *                or graphics.library/BltMaskBitMapRastPort() if
  2936. *                a mask is provided.
  2937. *
  2938. *            LAIM_BitMapLeft (UWORD) - Left corner of the image data
  2939. *                to blit into the window (the second parameter for
  2940. *                BltBitMapRastPort()).
  2941. *
  2942. *            LAIM_BitMapTop (UWORD) - Top corner of the image data
  2943. *                to blit into the window (the third parameter for
  2944. *                BltBitMapRastPort()).
  2945. *
  2946. *            LAIM_BitMapWidth (UWORD) - Width of the bitmap area to
  2947. *                blit into the window.
  2948. *
  2949. *            LAIM_BitMapHeight (UWORD) - Height of the bitmap area to
  2950. *                blit into the window.
  2951. *
  2952. *            LAIM_BitMapMask (PLANEPTR) - Pointer to a bit plane mask
  2953. *                to blit the image bitmap through. Must follow the
  2954. *                rules documented for for BltMaskBitMapRastPort().
  2955. *                The blit operation will use the minterm for
  2956. *                transparency.
  2957. *
  2958. *
  2959. *        INTEGER_KIND:
  2960. *
  2961. *            LAIN_LastGadget (BOOL) - Pressing return with this
  2962. *                gadget active will stop activating the next
  2963. *                following string gadget type if TRUE is passed.
  2964. *                Default: FALSE
  2965. *
  2966. *            LAIN_Min (LONG) - Minimum accepted numeric value.
  2967. *                Default: -2147483647
  2968. *
  2969. *            LAIN_Max (LONG) - Maximum accepted numeric value.
  2970. *                Default:  2147483647
  2971. *
  2972. *            LAIN_UseIncrementers (BOOL) - Use TRUE to add incrementer
  2973. *                arrow buttons to the right of the numeric entry field.
  2974. *                These buttons will let you cycle through a set of
  2975. *                numbers to be displayed in the numeric entry field.
  2976. *                Default: FALSE
  2977. *
  2978. *            LAIN_HistoryLines (LONG) - Number of numbers entered to
  2979. *                keep as a backlog.
  2980. *                Default: 0
  2981. *
  2982. *            LAIN_HistoryHook (struct Hook *) - Hook code to call when
  2983. *                entering a number into the backlog. See gtlayout.h for
  2984. *                more information.
  2985. *                Default: NULL
  2986. *
  2987. *            LAIN_IncrementerHook (struct Hook *) - Hook code to call
  2988. *                when cycling through numeric values. See gtlayout.h for
  2989. *                more information.
  2990. *                Default: NULL
  2991. *
  2992. *            LAIN_Activate (BOOL) - When the window opens, make this
  2993. *                gadget the active one. (V21)
  2994. *
  2995. *                    NOTE: There can be only one gadget of this type
  2996. *                        per window.
  2997. *
  2998. *                Default: FALSE
  2999. *
  3000. *
  3001. *        LEVEL_KIND:
  3002. *
  3003. *            All tags are supported which SLIDER_KIND supports.
  3004. *            The gadget level display however, can only be aligned
  3005. *            to the left border.
  3006. *
  3007. *            LAVL_Freedom (WORD) - Selects the orientation of the
  3008. *                slider body; can be either FREEHORIZ or FREEVERT. (V41)
  3009. *
  3010. *                Default: FREEHORIZ
  3011. *
  3012. *            LAVL_Ticks (WORD) - Selects if and where to place tick
  3013. *                marks next to the slider body. Can be one of the
  3014. *                the following: TICKS_None (no ticks), TICKS_Left
  3015. *                (place ticks left of the body), TICKS_Above (place
  3016. *                ticks above the body), TICKS_Both (place ticks on
  3017. *                both sides of the body). (V41)
  3018. *
  3019. *                Default: TICKS_None
  3020. *
  3021. *            LAVL_NumTicks (LONG) - Number of tick marks to draw. (V41)
  3022. *
  3023. *            LAVL_Lines (LONG) - Height of the slider, if FREEVERT. (V41)
  3024. *
  3025. *
  3026. *        LISTVIEW_KIND:
  3027. *
  3028. *            LALV_ExtraLabels (STRPTR *) - Place extra line
  3029. *                labels at the right of the box. Terminate
  3030. *                this array with NULL.
  3031. *
  3032. *            LALV_Labels (STRPTR *) - The labels to display
  3033. *                inside the box, you can pass this array of
  3034. *                strings in rather than passing an initialized
  3035. *                List of text via GTLV_Labels. Terminate
  3036. *                this array with NULL.
  3037. *
  3038. *            LALV_CursorKey (BOOL) - Let the user operate this
  3039. *                listview using the cursor keys.
  3040. *
  3041. *                    NOTE: there can be only one single listview
  3042. *                        per window to sport this feature.
  3043. *
  3044. *                Default: FALSE
  3045. *
  3046. *            LALV_Lines (LONG) - The number of text lines this
  3047. *                listview is to display.
  3048. *
  3049. *            LALV_Link (LONG) - The Gadget ID of a string gadget
  3050. *                to attach to this listview.
  3051. *
  3052. *                    NOTE: you need to
  3053. *                        add the Gadget in question before you add the
  3054. *                        listview to refer to it or the layout routine
  3055. *                        will get confused.
  3056. *
  3057. *                Passing the value NIL_LINK will create a listview
  3058. *                which displays the currently selected item, otherwise
  3059. *                you will get a read-only list.
  3060. *
  3061. *            LALV_FirstLabel (LONG) - Locale string ID of the first
  3062. *                text to use as a list label. Works in conjunction
  3063. *                with LALV_LastLabel.
  3064. *
  3065. *            LALV_LastLabel (LONG) - Locale string ID of the last
  3066. *                text to use as a list label. Works in conjunction
  3067. *                with LALV_FirstLabel. When building the interface the
  3068. *                code will loop from FirstLabel..LastLabel, look
  3069. *                up the corresponding locale strings and use the
  3070. *                data to make up the label text to appear in the
  3071. *                list.
  3072. *
  3073. *            LALV_LabelTable (LONG *) - Pointer to an array of IDs
  3074. *                to use for building the listview contents. This requires
  3075. *                that a locale hook is provided with the layout handle.
  3076. *                The array is terminated by -1.
  3077. *
  3078. *            LALV_MaxGrowX (LONG) - Maximum width of this object
  3079. *                measured in characters. When the first layout pass
  3080. *                is finished and there is still enough space left
  3081. *                to make the listview wider, the width is increased
  3082. *                until it hits the limit specified using this tag.
  3083. *
  3084. *                    NOTE: there can be only one single listview
  3085. *                        per window to sport this feature.
  3086. *
  3087. *                Default: 0
  3088. *
  3089. *            LALV_MaxGrowY (LONG) - Maximum height of this object
  3090. *                measured in lines. When the first layout pass is
  3091. *                finished and there is still enough space left to
  3092. *                make the listview higher, the height is increased
  3093. *                until it hits the limit specified using this tag.
  3094. *
  3095. *                    NOTE: there can be only one single listview
  3096. *                        per window to sport this feature.
  3097. *
  3098. *                Default: 0
  3099. *
  3100. *            LALV_ResizeX (BOOL) - Makes this listview resizable
  3101. *                in the horizontal direction, attaches a sizing
  3102. *                gadget to the window to open and handles window
  3103. *                resize operations automatically. (V9)
  3104. *
  3105. *                    NOTE: there can be only one single listview
  3106. *                        per window to sport this feature.
  3107. *
  3108. *                        Also listen to IDCMP_CLOSEWINDOW events
  3109. *                        which may be generated if the layout
  3110. *                        engine runs out of memory when rebuilding
  3111. *                        the user interface.
  3112. *
  3113. *                Default: FALSE
  3114. *
  3115. *            LALV_ResizeY (BOOL) - Makes this listview resizable
  3116. *                in the vertical direction, attaches a sizing
  3117. *                gadget to the window to open and handles window
  3118. *                resize operations automatically. (V9)
  3119. *
  3120. *                    NOTE: there can be only one single listview
  3121. *                        per window to sport this feature.
  3122. *
  3123. *                        Also listen to IDCMP_CLOSEWINDOW events
  3124. *                        which may be generated if the layout
  3125. *                        engine runs out of memory when rebuilding
  3126. *                        the user interface.
  3127. *
  3128. *                Default: FALSE
  3129. *
  3130. *            LALV_MinChars (WORD) - Minimum width for this
  3131. *                object, measured in characters. Used in
  3132. *                conjunction with LALV_ResizeX. (V9)
  3133. *
  3134. *            LALV_MinLines (WORD) - Minimum height for this
  3135. *                object, measured in lines. Used in
  3136. *                conjunction with LALV_ResizeY. (V9)
  3137. *
  3138. *            LALV_LockSize (BOOL) - After doing the initial layout
  3139. *                for this object, do not adapt its size again during
  3140. *                subsequent layouts. This is particularly useful if
  3141. *                you have a LISTVIEW_KIND object in a paged group
  3142. *                and keep adding new entries to the list. You need
  3143. *                to specify an object width using LA_Chars, otherwise
  3144. *                the layout engine may make it not wide enough to
  3145. *                display any entries. (V8)
  3146. *
  3147. *            LALV_FlushLabelLeft (BOOL) - For a gadget label placed
  3148. *                above the listview align the text to the left edge
  3149. *                of the view. (V9)
  3150. *
  3151. *            LALV_TextAttr (struct TextAttr *) - You can specify a
  3152. *                fixed-width font to be used for the list display.
  3153. *                The TextAttr (or TTextAttr) you provide must be ready
  3154. *                to go so the layout code can open the font later.
  3155. *
  3156. *                To get the current system default font, which is
  3157. *                guaranteed to be fixed-width, pass ~0 instead of a
  3158. *                pointer to a TextAttr structure. (V10)
  3159. *
  3160. *                    NOTE: The font *MUST* be fixed-width or the layout
  3161. *                        will fail.
  3162. *
  3163. *                         Choose your font in such a way that it matches
  3164. *                         in width and height with the other probably
  3165. *                         proportional-spaced user interface font.
  3166. *
  3167. *                         If the layout engine decides to step down in
  3168. *                         font size, all LISTVIEW_KIND objects which were
  3169. *                         configured to use a special fixed-width font
  3170. *                         will `forget' about it. This won't matter much
  3171. *                         as the fonts the engine chooses will always be
  3172. *                         fixed-width anyway.
  3173. *
  3174. *            LALV_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3175. *                which will be set to the gadget's current setting.
  3176. *                If this tag is set, you will hear no events from this
  3177. *                object any more. (V23)
  3178. *
  3179. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3180. *                        which may be generated if the layout
  3181. *                        engine runs out of memory when rebuilding
  3182. *                        the user interface.
  3183. *
  3184. *            LALV_Selected (LONG) - In this context, this tag is an
  3185. *                alias for GTLV_Selected. See
  3186. *                gtlayout.library/LT_SetAttributes for more information
  3187. *                on how the meaning of this tag differs from this (V34).
  3188. *
  3189. *
  3190. *        MX_KIND:
  3191. *
  3192. *            LAMX_FirstLabel (LONG) - Locale string ID of the first
  3193. *                text to use as a label. Works in conjunction
  3194. *                with LAMX_LastLabel.
  3195. *
  3196. *            LAMX_LastLabel (LONG) - Locale string ID of the last
  3197. *                text to use as a label. Works in conjunction
  3198. *                with LAMX_FirstLabel. When building the interface the
  3199. *                code will loop from FirstLabel..LastLabel, look
  3200. *                up the corresponding locale strings and use the
  3201. *                data to make up the label text.
  3202. *
  3203. *            LAMX_LabelTable (LONG *) - Pointer to an array of IDs
  3204. *                to use for building the radio labels. This requires
  3205. *                that a locale hook is provided with the layout handle.
  3206. *                The array is terminated by -1.
  3207. *
  3208. *            LAMX_TabKey (BOOL) - Connect this object to the tabulator
  3209. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3210. *                to cycle to the previous entry. (V9)
  3211. *
  3212. *                    NOTE: there can be only one single button per
  3213. *                        window to use this feature.
  3214. *
  3215. *                Default: FALSE
  3216. *
  3217. *            LAMX_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3218. *                which will be set to the gadget's current setting.
  3219. *                If this tag is set, you will hear no events from this
  3220. *                object any more. (V7)
  3221. *
  3222. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3223. *                        which may be generated if the layout
  3224. *                        engine runs out of memory when rebuilding
  3225. *                        the user interface.
  3226. *
  3227. *
  3228. *        PALETTE_KIND:
  3229. *
  3230. *            LAPA_SmallPalette (BOOL) - Make the palette display
  3231. *                a bit smaller than usual.
  3232. *                Default: FALSE
  3233. *
  3234. *            LAPA_Lines (LONG) - Number of lines the palette
  3235. *                display should cover.
  3236. *                Default: No preference
  3237. *
  3238. *            LAPA_UsePicker (BOOL) - This tag effectively changes the
  3239. *                gadget type. Instead of a list of colours to pick from
  3240. *                the user will see a rectangle filled in the selected
  3241. *                colour with a picker button next to it. This gadget
  3242. *                will generate IDCMP_IDCMPUPDATE events when the picker
  3243. *                button is pressed. (V10)
  3244. *
  3245. *
  3246. *        PASSWORD_KIND (string gadget type which does not
  3247. *            display its contents):
  3248. *
  3249. *            LAPW_LastGadget (BOOL) - Pressing return with this
  3250. *                gadget active will stop activating the next
  3251. *                following string gadget type if TRUE is passed.
  3252. *                Default: FALSE
  3253. *
  3254. *            LAPW_HistoryLines (LONG) - Number of lines to keep as
  3255. *                a backlog.
  3256. *                Default: 0
  3257. *
  3258. *            LAPW_HistoryHook (struct Hook *) - Hook code to call
  3259. *                when entering a line into the backlog. See gtlayout.h
  3260. *                for more information.
  3261. *                Default: NULL
  3262. *
  3263. *            LAPW_Activate (BOOL) - When the window opens, make this
  3264. *                gadget the active one. (V21)
  3265. *
  3266. *                    NOTE: There can be only one gadget of this type
  3267. *                        per window.
  3268. *
  3269. *                Default: FALSE
  3270. *
  3271. *            This object type accepts all the GTST_#? tag items.
  3272. *
  3273. *
  3274. *        POPUP_KIND:
  3275. *
  3276. *            (This features requires gtlayout.library v22 or higher
  3277. *             and Kickstart 3.0 or higher).
  3278. *
  3279. *            LAPU_FirstLabel (LONG) - Locale string ID of the first
  3280. *                text to use as a label. Works in conjunction
  3281. *                with LAPU_LastLabel.
  3282. *
  3283. *            LAPU_LastLabel (LONG) - Locale string ID of the last
  3284. *                text to use as a label. Works in conjunction
  3285. *                with LAPU_FirstLabel. When building the interface the
  3286. *                code will loop from FirstLabel..LastLabel, look
  3287. *                up the corresponding locale strings and use the
  3288. *                data to make up the label text.
  3289. *
  3290. *            LAPU_LabelTable (LONG *) - Pointer to an array of IDs
  3291. *                to use for building the cycle labels. This requires
  3292. *                that a locale hook is provided with the layout handle.
  3293. *                The array is terminated by -1.
  3294. *
  3295. *            LAPU_TabKey (BOOL) - Connect this object to the tabulator
  3296. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3297. *                to cycle to the previous entry.
  3298. *
  3299. *                    NOTE: there can be only one single button per
  3300. *                        window to use this feature.
  3301. *
  3302. *                Default: FALSE
  3303. *
  3304. *            LAPU_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3305. *                which will be set to the gadget's current setting.
  3306. *                If this tag is set, you will hear no events from this
  3307. *                object any more.
  3308. *
  3309. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3310. *                        which may be generated if the layout
  3311. *                        engine runs out of memory when rebuilding
  3312. *                        the user interface.
  3313. *
  3314. *            LAPU_CentreActive (BOOL) - If TRUE, the popup menu will
  3315. *                appear with the currently active entry centred below
  3316. *                the mouse pointer. (V31)
  3317. *
  3318. *            LAPU_Labels (STRPTR *) - Pointer to NULL-terminated array
  3319. *                of strings that are the choices offered.
  3320. *
  3321. *
  3322. *        SCROLLER_KIND:
  3323. *
  3324. *            LASC_Thin (BOOL) - Make the scroller a bit thinner
  3325. *                than usual.
  3326. *                Default: FALSE
  3327. *
  3328. *            GA_RelVerify (BOOL) - Hear every IDCMP_GADGETUP
  3329. *                event from scroller.
  3330. *                Default: TRUE
  3331. *
  3332. *                        NOTE: This is different from what
  3333. *                         gadtools.library uses.
  3334. *
  3335. *            GA_Immediate (BOOL) - Hear every IDCMP_GADGETDOWN
  3336. *                event from scroller
  3337. *                Default: TRUE
  3338. *
  3339. *                        NOTE: This is different from what
  3340. *                         gadtools.library uses.
  3341. *
  3342. *
  3343. *        SLIDER_KIND:
  3344. *
  3345. *            LASL_FullCheck: TRUE will cause the code to rattle
  3346. *                through all possible slider settings, starting
  3347. *                from the minimum value, ending at the maximum value.
  3348. *                While this may be a good idea for a display
  3349. *                function to map slider levels to text strings
  3350. *                of varying length it might be a problem when
  3351. *                it comes to display a range of numbers from
  3352. *                1 to 40,000: the code will loop through
  3353. *                40,000 iterations trying to find the longest
  3354. *                string.
  3355. *
  3356. *                FALSE will cause the code to calculate the
  3357. *                longest level string based only on the
  3358. *                minimum and the maximum value to check.
  3359. *                While this is certainly a good a idea when
  3360. *                it comes to display a range of numbers from
  3361. *                1 to 40,000 as only two values will be
  3362. *                checked the code may fail to produce
  3363. *                accurate results for sliders using display
  3364. *                functions mapping slider levels to strings.
  3365. *
  3366. *                Default: TRUE
  3367. *
  3368. *
  3369. *        STRING_KIND:
  3370. *
  3371. *            LAST_LastGadget (BOOL) - Pressing return with this
  3372. *                gadget active will stop activating the next
  3373. *                following string gadget type if TRUE is passed.
  3374. *                Default: FALSE
  3375. *
  3376. *            LAST_Link (LONG) - Gadget ID of the listview to attach
  3377. *                this string gadget to.
  3378. *
  3379. *                    NOTE: you need to add the string gadget before
  3380. *                        you add the listview to refer to it or the
  3381. *                        layout routine will get confused.
  3382. *
  3383. *            LAST_Picker (BOOL) - Attach a `select' button to the
  3384. *                right hand side of the string gadget.
  3385. *                Default: FALSE
  3386. *
  3387. *            LAST_HistoryLines (LONG) - Number of lines to keep as
  3388. *                a backlog.
  3389. *                Default: 0
  3390. *
  3391. *            LAST_HistoryHook (struct Hook *) - Hook code to call
  3392. *                when entering a line into the backlog. See gtlayout.h
  3393. *                for more information.
  3394. *                Default: NULL
  3395. *
  3396. *            LAST_Activate (BOOL) - When the window opens, make this
  3397. *                gadget the active one. (V21)
  3398. *
  3399. *                    NOTE: There can be only one gadget of this type
  3400. *                        per window.
  3401. *
  3402. *                Default: FALSE
  3403. *
  3404. *
  3405. *        TAB_KIND:
  3406. *
  3407. *            (This features requires gtlayout.library v24 or higher)
  3408. *
  3409. *            LATB_FirstLabel (LONG) - Locale string ID of the first
  3410. *                text to use as a label. Works in conjunction
  3411. *                with LATB_LastLabel.
  3412. *
  3413. *            LATB_LastLabel (LONG) - Locale string ID of the last
  3414. *                text to use as a label. Works in conjunction
  3415. *                with LATB_FirstLabel. When building the interface the
  3416. *                code will loop from FirstLabel..LastLabel, look
  3417. *                up the corresponding locale strings and use the
  3418. *                data to make up the label text.
  3419. *
  3420. *            LATB_LabelTable (LONG *) - Pointer to an array of IDs
  3421. *                to use for building the cycle labels. This requires
  3422. *                that a locale hook is provided with the layout handle.
  3423. *                The array is terminated by -1.
  3424. *
  3425. *            LATB_TabKey (BOOL) - Connect this object to the tabulator
  3426. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3427. *                to cycle to the previous entry.
  3428. *
  3429. *                    NOTE: there can be only one single button per
  3430. *                        window to use this feature.
  3431. *
  3432. *                Default: FALSE
  3433. *
  3434. *            LATB_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3435. *                which will be set to the gadget's current setting.
  3436. *                If this tag is set, you will hear no events from this
  3437. *                object any more.
  3438. *
  3439. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3440. *                        which may be generated if the layout
  3441. *                        engine runs out of memory when rebuilding
  3442. *                        the user interface.
  3443. *
  3444. *            LATB_FullSize (BOOL) - By default a TAB_KIND object
  3445. *                covers the entire width of the group it sits in.
  3446. *                With LATB_FullSize set to true it will cover the
  3447. *                width of the entire Window.
  3448. *
  3449. *                Default: FALSE
  3450. *
  3451. *            LATB_Labels (STRPTR *) - Pointer to NULL-terminated array
  3452. *                of strings that are the choices offered.
  3453. *
  3454. *
  3455. *        TAPEDECK_KIND:
  3456. *
  3457. *            LATD_ButtonType (LONG) - Select the image to display
  3458. *                in the button, must be one of the following:
  3459. *
  3460. *                    TDBT_BACKWARD
  3461. *                        "<<" Symbol
  3462. *
  3463. *                    TDBT_FORWARD
  3464. *                        ">>" Symbol
  3465. *
  3466. *                    TDBT_PREVIOUS
  3467. *                        "|<" Symbol
  3468. *
  3469. *                    TDBT_NEXT
  3470. *                        ">|" Symbol
  3471. *
  3472. *                    TDBT_STOP
  3473. *                        Stop symbol (filled square)
  3474. *
  3475. *                    TDBT_PAUSE
  3476. *                        "||" pause symbol (broken square)
  3477. *
  3478. *                    TDBT_RECORD
  3479. *                        Record symbol (filled circle)
  3480. *
  3481. *                    TDBT_REWIND
  3482. *                        "<" symbol
  3483. *
  3484. *                    TDBT_EJECT
  3485. *                        Eject symbol (broken upward pointing arrow)
  3486. *
  3487. *                    TDBT_PLAY
  3488. *                        ">" symbol
  3489. *
  3490. *            LATD_Toggle (BOOL) - Make this object a toggle-select
  3491. *                button.
  3492. *                Default: FALSE
  3493. *
  3494. *            LATD_Pressed (BOOL) - Make this button appear to be
  3495. *                pressed.
  3496. *
  3497. *                    NOTE: requires "LATD_Toggle,TRUE" attribute.
  3498. *
  3499. *                Default: FALSE
  3500. *
  3501. *            LATD_Smaller (BOOL) - Make this button a bit smaller
  3502. *                than usual.
  3503. *                Default: FALSE
  3504. *
  3505. *            LATD_Tick (BOOL) - Hear IDCMP_GADGETUP events while the
  3506. *                buttons is being pressed; the IntuiMessage->Code entry
  3507. *                will be 0 while the button is being pressed, and
  3508. *                will be 1 as soon as the button is released. (V12)
  3509. *
  3510. *                Default: FALSE
  3511. *
  3512. *
  3513. *        TEXT_KIND:
  3514. *
  3515. *            LATX_Picker (BOOL) - Attach a `select' button to the
  3516. *                right hand side of the text display.
  3517. *                Default: FALSE
  3518. *
  3519. *            LATX_LockSize (BOOL) - After doing the initial layout
  3520. *                for this object, do not adapt its size again during
  3521. *                subsequent layouts. This is particularly useful if
  3522. *                you have a TEXT_KIND object in a paged group
  3523. *                and update its contents later. You need
  3524. *                to specify an object width using LA_Chars, otherwise
  3525. *                the layout engine may make it not wide enough to
  3526. *                display any text. (V15)
  3527. *
  3528. *
  3529. *        VERTICAL_KIND (group to align objects vertically):
  3530. *        HORIZONTAL_KIND (group to align objects horizontally):
  3531. *
  3532. *            LAGR_Spread (BOOL) - Place all objects in this
  3533. *                group with roughly the same amount of space
  3534. *                between them.
  3535. *                Default: FALSE
  3536. *
  3537. *            LAGR_SameSize (BOOL) - Make all objects in this
  3538. *                group the same size (for vertical groups:
  3539. *                the same height, for horizontal groups:
  3540. *                the same width).
  3541. *                Default: FALSE
  3542. *
  3543. *            LAGR_LastAttributes (BOOL) - Try to copy the
  3544. *                size of the previous group for this new
  3545. *                group. May not work if this group turns
  3546. *                out to be larger than the previous group.
  3547. *                Default: FALSE
  3548. *
  3549. *            LAGR_ActivePage (LONG) - Organize all child
  3550. *                groups as pages which can be flipped through
  3551. *                using LT_SetAttributes(). You need to
  3552. *                specify the number of the first page to
  3553. *                display, starting from 0.
  3554. *
  3555. *                    NOTE: Specifying this tag actually enables
  3556. *                        the paging feature. If you omit this
  3557. *                        tag calls to flip to a specific
  3558. *                        page will fail.
  3559. *
  3560. *                Default: No paging
  3561. *
  3562. *            LAGR_Frame (BOOL) - Draw a recessed frame around
  3563. *                this group, even if there is no group label. (V7)
  3564. *
  3565. *            LAGR_IndentX (BOOL) - Add extra horizontal indentation
  3566. *                for this group. (V10)
  3567. *
  3568. *            LAGR_IndentY (BOOL) - Add extra vertical indentation
  3569. *                for this group. (V10)
  3570. *
  3571. *            LAGR_NoIndent (BOOL) - Inhibit automatic size adjustion
  3572. *                and centring of this group if it is smaller than
  3573. *                the neighbouring groups. (V21)
  3574. *
  3575. *            LAGR_SameWidth (WORD) - During the final layout pass,
  3576. *                make this group the same width as the group which
  3577. *                uses the given ID. Not implemented yet. (V25)
  3578. *
  3579. *            LAGR_SameHeight (WORD) - During the final layout pass,
  3580. *                make this group the same height as the group which
  3581. *                uses the given ID. Not implemented yet. (V25)
  3582. *
  3583. *            LAGR_FrameGroup (UWORD) - Surround this group with a
  3584. *                frame. Must be one of FRAMETYPE_Label or FRAMETYPE_Tab.
  3585. *                FRAMETYPE_Label works like "LAGR_Frame,TRUE," while
  3586. *                FRAMETYPE_Tab is for use with a TAB_KIND object you
  3587. *                must put directly on top of this group or the group
  3588. *                will look a little silly. (V38)
  3589. *
  3590. *                Default: FRAMETYPE_None
  3591. *
  3592. *
  3593. *        XBAR_KIND (horizontal separator bar):
  3594. *
  3595. *            LAXB_FullSize (BOOL) - Make this separator bar span
  3596. *                the entire window width.
  3597. *
  3598. *
  3599. *        YBAR_KIND (vertical separator bar):
  3600. *
  3601. *            No tags are defined for this type of object.
  3602. *
  3603. *
  3604. *   RESULT
  3605. *    none
  3606. *
  3607. *   BUGS
  3608. *    Up to v25 the SCROLLER_KIND object did not support GA_Immediate
  3609. *    or GA_RelVerify. The space for the variables was there, but the
  3610. *    code was missing.
  3611. *
  3612. *    POPUP_KIND objects don't work well in simple refresh windows,
  3613. *    as refresh events can get lost. Use a smart refresh window
  3614. *    instead or call gadtools.library/LT_CatchUpRefresh() regularly.
  3615. *
  3616. *   SEE ALSO
  3617. *    gadtools.library/CreateGadgetA
  3618. *
  3619. ******************************************************************************
  3620. *
  3621. */
  3622.  
  3623. VOID LIBENT
  3624. LT_NewA(REG(a0) LayoutHandle *handle,REG(a1) struct TagItem *tagList)
  3625. {
  3626.     if(handle)
  3627.     {
  3628.         struct TagItem *List,*Entry;
  3629.         STRPTR label;
  3630.         LONG type;
  3631.         LONG id;
  3632.  
  3633.         type    = -1;
  3634.         label    = NULL;
  3635.         id        = 0;
  3636.         List    = tagList;
  3637.  
  3638.         while(Entry = NextTagItem(&List))
  3639.         {
  3640.             switch(Entry->ti_Tag)
  3641.             {
  3642.                 case LA_Type:
  3643.  
  3644.                     type = Entry->ti_Data;
  3645.                     break;
  3646.  
  3647.                 case LA_ID:
  3648.  
  3649.                     id = Entry->ti_Data;
  3650.                     break;
  3651.  
  3652.                 case LA_LabelID:
  3653.  
  3654.                     if(handle->LocaleHook)
  3655.                         label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)Entry->ti_Data);
  3656.                     else
  3657.                     {
  3658.                         handle->Failed = TRUE;
  3659.  
  3660.                         return;
  3661.                     }
  3662.  
  3663.                     break;
  3664.  
  3665.                 case LA_LabelText:
  3666.  
  3667.                     label = (STRPTR)Entry->ti_Data;
  3668.                     break;
  3669.             }
  3670.         }
  3671.  
  3672.         LT_AddA(handle,type,label,id,tagList);
  3673.     }
  3674. }
  3675.  
  3676.  
  3677. /*****************************************************************************/
  3678.  
  3679.  
  3680. /****** gtlayout.library/LT_EndGroup ******************************************
  3681. *
  3682. *   NAME
  3683. *    LT_EndGroup -- end a group declaration.
  3684. *
  3685. *   SYNOPSIS
  3686. *    LT_EndGroup(Handle);
  3687. *                 A0
  3688. *
  3689. *    VOID LT_EndGroup(LayoutHandle *);
  3690. *
  3691. *   FUNCTION
  3692. *      This is just a short form of
  3693. *
  3694. *           LT_New(Handle,
  3695. *               LA_Type, END_KIND,
  3696. *           TAG_DONE);
  3697. *
  3698. *      It helps to save (some) space.
  3699. *
  3700. *   INPUTS
  3701. *        Handle - Pointer to LayoutHandle.
  3702. *
  3703. *   RESULT
  3704. *    none
  3705. *
  3706. *   SEE ALSO
  3707. *    gtlayout.library/LT_New
  3708. *
  3709. ******************************************************************************
  3710. *
  3711. */
  3712.  
  3713. VOID LIBENT
  3714. LT_EndGroup(REG(a0) LayoutHandle *handle)
  3715. {
  3716.     if(handle && !handle->Failed)
  3717.         handle->CurrentGroup = handle->CurrentGroup->Special.Group.ParentGroup;
  3718. }
  3719.